Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draggable: No need to update z-index on every activation - prevents scroll on iPhone #156

Open
FlowIT-JIT opened this issue Mar 20, 2022 · 1 comment
Labels

Comments

@FlowIT-JIT
Copy link
Collaborator

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.

@Jemt 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
@Jemt
Copy link
Owner

Jemt commented 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.

@Jemt Jemt added bug and removed minor bug labels Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants