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

Selection area is not visible on position:fixed/absolute elements. #123

Closed
Alexloof opened this issue Jun 16, 2021 · 13 comments
Closed

Selection area is not visible on position:fixed/absolute elements. #123

Alexloof opened this issue Jun 16, 2021 · 13 comments
Labels
feature request New feature requested

Comments

@Alexloof
Copy link

I have problems showing the selection area when the element has a fixed or absolute position value. (Probably because of z-index?)

I guess a solution could be to add an optional classname to the div element that is created, so i can bump the z-index. Tweaking the z-index on the .selection-area class does not work, so i think it should be possible to tweak the style on the parent div that is created.

Does it make sense?

Br Alex

@Alexloof Alexloof added the feature request New feature requested label Jun 16, 2021
@simonwep
Copy link
Owner

Could you please provide a CodeSandbox or JSFiddle? It'll help me to take a closer look at your case :) In your case maybe z-index: xy !important; would work? Just to see if it's the element-style that prevents you from doing so ^^

@Alexloof
Copy link
Author

@Alexloof
Copy link
Author

So from what i can see, if the fixed positioned element has a z-index more than 1 it does not work. And unfortunately, in my case, the element must have a higher z-index than 1.

@simonwep
Copy link
Owner

Okay, I see - the problem is that you only apply the z-index to the selection-area. But what you want to apply it to is the wrapper (clipping-element). That is currently not possible, I'll plan this for v3.1, with v3 will also come native preact/react support which you can use then :)

Unfortunately it's currently also not possible to access the clipping element (I'll make that a feature as well!). As a hacky workaround (which only works for the version you're currently using because of minification) you could manually apply a zIndex: https://codesandbox.io/s/laughing-platform-hbshc

@simonwep simonwep added this to the v3.1.0 milestone Jun 16, 2021
@simonwep simonwep removed this from the v3.0.0-beta.2 milestone Jun 27, 2021
@simonwep
Copy link
Owner

Available in v3.0.0-beta.2, this requires an upgrade to v3 :)

@Alexloof
Copy link
Author

Alexloof commented Jul 5, 2021

@simonwep I have upgraded to latest, but does not look like it is working. I think the custom classname does not get attached to the div element.

https://codesandbox.io/s/boring-gagarin-i833v?file=/src/App.js

@simonwep
Copy link
Owner

simonwep commented Jul 5, 2021

Huh, that is weird - well, I'll take a look at it later today and publish a new beta version if required :) Thank you for trying out the beta though!

@Alexloof
Copy link
Author

Alexloof commented Jul 5, 2021

@simonwep No problems 👍 Sounds great!

simonwep added a commit that referenced this issue Jul 5, 2021
Fix deep-assign utility
Fixes regression in #123
simonwep added a commit that referenced this issue Jul 5, 2021
Fix deep-assign utility
Fixes regression in #123
simonwep added a commit that referenced this issue Jul 5, 2021
Fix deep-assign utility
Fixes regression in #123
@simonwep
Copy link
Owner

simonwep commented Jul 5, 2021

I just published v3.0.0-beta.6 - should be fixed there.

@Alexloof
Copy link
Author

Alexloof commented Jul 6, 2021

@simonwep Thanks now it works!
Btw - I noticed the React wrapper broke from this update. I have written my own wrapper, but some other users might be affected.

@simonwep
Copy link
Owner

simonwep commented Jul 6, 2021

Ah god dammit 😔 what happened? Normally the wrappers shouldn't be affected by config updates... I'll look into it later.
Could this be related to #124?

@Alexloof
Copy link
Author

Alexloof commented Jul 7, 2021

@simonwep i think the error i noticed came from the deepAssign utility function.

@simonwep
Copy link
Owner

simonwep commented Jul 7, 2021

Ah, allright - yeah that should be fixed with the most recent version - thank you :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature requested
Projects
None yet
Development

No branches or pull requests

2 participants