@humandialog/forms.svelte 1.3.1 → 1.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/desk.svelte +27 -3
- package/package.json +1 -1
package/desk.svelte
CHANGED
|
@@ -159,11 +159,15 @@
|
|
|
159
159
|
window.addEventListener('resize', on_resize)
|
|
160
160
|
|
|
161
161
|
const vp = window.visualViewport;
|
|
162
|
-
|
|
163
162
|
vp?.addEventListener('resize', onViewportResize)
|
|
164
163
|
setViewportHeight(vp)
|
|
165
164
|
|
|
165
|
+
document.addEventListener('selectionchange', onSelectionChanged)
|
|
166
|
+
document.addEventListener('focusout', onFocusOut)
|
|
167
|
+
|
|
166
168
|
return () => {
|
|
169
|
+
document.removeEventListener('focusout', onFocusOut)
|
|
170
|
+
document.removeEventListener('selectionchange', onSelectionChanged)
|
|
167
171
|
vp?.removeEventListener('resize', onViewportResize)
|
|
168
172
|
window.removeEventListener('resize', on_resize)
|
|
169
173
|
|
|
@@ -202,14 +206,34 @@
|
|
|
202
206
|
const vp = window.visualViewport;
|
|
203
207
|
setViewportHeight(vp)
|
|
204
208
|
|
|
209
|
+
determineFABVisibility();
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function onSelectionChanged(e)
|
|
213
|
+
{
|
|
214
|
+
determineFABVisibility();
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function onFocusOut(e)
|
|
218
|
+
{
|
|
219
|
+
determineFABVisibility();
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
function determineFABVisibility()
|
|
223
|
+
{
|
|
224
|
+
let new_fab_visibility;
|
|
225
|
+
|
|
205
226
|
if(isOnScreenKeyboardVisible())
|
|
206
227
|
{
|
|
207
|
-
|
|
228
|
+
new_fab_visibility = 'hidden'
|
|
208
229
|
}
|
|
209
230
|
else
|
|
210
231
|
{
|
|
211
|
-
|
|
232
|
+
new_fab_visibility = fab_base_visibility;
|
|
212
233
|
}
|
|
234
|
+
|
|
235
|
+
if(fab_visibility != new_fab_visibility)
|
|
236
|
+
fab_visibility = new_fab_visibility;
|
|
213
237
|
}
|
|
214
238
|
|
|
215
239
|
let operationsComponent
|