-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add SelectionAlwaysOnDisplay plugin #6872
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
size-limit report 📦
|
I wonder if RetainSelection is a good/intuitive plugin name, given that we also have the (non-visible) selection concept |
The display isn't precisely the same as a normal selection (in chrome at least), but I think this provides a lot of value at least as a demonstration of the technique retain-selection-rects.mov |
I'd be happy to discuss this further in our next session. Ideally, this is an exact match of the actual browser representation, but my hunch is that browser provided rects is the closest the browser provides and the rest is on us which is why this is particularly hard problem. A potential option to fix this problem is to always customize the selection render when this is enabled (e934b9c). The trade-off is performance and the fact that we'd now trust selection to our built-in modules that are still experimental. Screen.Recording.2024-11-27.at.2.02.36.PM.movOverall, I feel like this is a small and reasonable trade-off but we can also offer the two variants and let the users decide. I can iterate on this on top, but then again, I'd love to hear your thoughts on this problem. |
I'd probably look at the highlight API instead of trying to render it ourselves and probably provide some sort of straightforward way for decorators to get highlighted as well https://developer.mozilla.org/en-US/docs/Web/API/CSS_Custom_Highlight_API |
@etrepum Had no idea this existed 😮 Let me take a look, it seems like it's very modern API and not sure it's polyfillable but might still work for this use case. Thanks again! |
This plugin already provides value in two different places internally, let's make it official
Screen.Recording.2024-11-26.at.4.30.08.PM.mov