-
Notifications
You must be signed in to change notification settings - Fork 716
[css-highlight-api] Need to support a mechanism for creating ranges inside textarea and input elements #4603
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
Comments
I suspect this might be best handled by an extension to range objects that can reach into these elements, and that this should be discussed over in https://github.com/whatwg/dom/issues |
Closing this issue out for now as it is not relevant for css-highlight-api-1. This will likely require a new proposal, and yes, it most likely live over in WHATWG DOM. |
I suspect we should check with the WHATWG / the TAG that they agree this is likely to be solved the way we think before closing, because if not, we've got some harder thinking to do. |
@frivoal I think this is beyond scope for css-highlight-api-1. This is also just a tracking issue for future work in WHATWG DOM. What's the best way to keep this issue around, but not let it block css-highlight-api-1? cc: @dandclark |
I think we should either conclude that this is indeed going to be solved by some future addition and close this issue (most likely), or that the fact that we haven't solved this shows the whole approach is wrong and we need to start from scratch (I very sincerely hope not). @atanassov @LeaVerou @plinss can the TAG have a look at this issue? |
Any updates on this thread? |
I just tested Chrome 121 and succeeded in setting highlights inside a contenteditable="true" div, and editing the content while maintaining the highlight. Do you have an example of it not working? Otherwise no update on the status of textarea. |
Here's an example with contenteditable="true" element. |
There's a lot going on in your example, but one thing I do notice is that DevTools says the CSS highlight is named 'search-result-highlight' but the js says HIGHLIGHT_NAME='match' If I edit the CSS to name the highlight 'match' I get a yellow "Hello". |
+1 on adding support for custom highlights As for |
Moving this issue over from: MicrosoftEdge/MSEdgeExplainers#78.
Textarea and input elements can't be highlighted with this proposal. We need a mechanism to express the position of a range inside these elements so that spellchecking/grammar extensions can add squiggles to these elements too.
The text was updated successfully, but these errors were encountered: