You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A draggable element will have its z-index increased by 1 every time the element is clicked/touched, to make sure it remains on top of other draggable elements - just like windows on a computer. However, this will quickly exhaust the reserved span of z-index values reserved for this (10.000-50.000) - the z-index value 50.000 is reserved for dialogs which must remain on top of draggable elements (alert, confirm, prompt).
Avoid incrementing z-index on every activation. It is only necessary to increment the z-index value when the previous draggable element activated is different from the current one being activated.
Avoid keeping a reference to previously activated elements - consider using a hash instead. Keeping a reference might prevent the browser from garbage collecting elements and associated event handlers which could hold large amounts of data in memory.
The text was updated successfully, but these errors were encountered:
Jemt
changed the title
Draggable: No need to update z-index on every activation
Draggable: No need to update z-index on every activation - prevents scroll on iPhone
Apr 16, 2022
Changed title to reflect a newly found problem related to updating z-index every time a draggable is touched. It prevents overflow:auto from working on iPhone (iOS 15.3.1) and on iPad (iOS 14.7.1). We use overflow:auto in Dialog to allow dialog content to be scrolled.
A draggable element will have its z-index increased by 1 every time the element is clicked/touched, to make sure it remains on top of other draggable elements - just like windows on a computer. However, this will quickly exhaust the reserved span of z-index values reserved for this (10.000-50.000) - the z-index value 50.000 is reserved for dialogs which must remain on top of draggable elements (alert, confirm, prompt).
Avoid incrementing z-index on every activation. It is only necessary to increment the z-index value when the previous draggable element activated is different from the current one being activated.
Avoid keeping a reference to previously activated elements - consider using a hash instead. Keeping a reference might prevent the browser from garbage collecting elements and associated event handlers which could hold large amounts of data in memory.
The text was updated successfully, but these errors were encountered: