mirror of
https://github.com/docusealco/docuseal
synced 2026-11-04 06:42:32 -05:00
expand native sheet when content overflows
This commit is contained in:
1 parent
5f5b49a1ba
commit
be621339c3
1 file changed
+9
@@ -1,6 +1,7 @@
|
||||
export default class extends HTMLElement {
|
||||
connectedCallback () {
|
||||
document.addEventListener('turbo:submit-end', this.onSubmit)
|
||||
this.addEventListener('click', this.onClick)
|
||||
}
|
||||
|
||||
disconnectedCallback () {
|
||||
@@ -15,4 +16,12 @@ export default class extends HTMLElement {
|
||||
|
||||
window.webkit?.messageHandlers?.modal?.postMessage({ action: 'submitted' })
|
||||
}
|
||||
|
||||
onClick = () => {
|
||||
setTimeout(() => {
|
||||
if (document.documentElement.scrollHeight > window.innerHeight) {
|
||||
window.webkit?.messageHandlers?.modal?.postMessage({ action: 'expand' })
|
||||
}
|
||||
}, 300)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user