-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
writingsuggestions
might need to default to "off"
#10209
Comments
Hey @marcoscaceres! Would you be able to provide some more details on the issues you've hit on those sites and their underlying cause(s)? |
For example with the form in https://www.reddit.com/submit The current result in the WebKit implementation is: This doesn't happen on all sites. For example, here currently on the Github form, this is working quite well. But it is breaking on some sites. |
Curious to learn more about how you ended up in this state? Would you be able to share more details about your order of operations? @marcoscaceres mentioned composition events...are you saying the reason Webkit's implementation of this feature is broken on Reddit is related to composition events? |
@sanketj, we will follow up with fuller details later today. |
In the case of Reddit’s submit page, either In WebKit, let’s say we type “predicta” and the browser suggests “predictable”, and we hit the tab key, we fire the following events in this order: On Reddit, this results in “predicapredictable ”. Because the code if minified, we are unsure which of @sanketj, could you please try the following code in Edge and let us know the event order that you are using (or any additional events you are firing)? <textarea rows="10" cols="150"></textarea>
<script>
const textarea = document.querySelector('textarea');
// Let's monitor the composition events
window.addEventListener('compositionstart', (event) => {
console.log('compositionstart', event);
});
window.addEventListener('compositionupdate', (event) => {
console.log('compositionupdate', event);
});
window.addEventListener('compositionend', (event) => {
console.log('compositionend', event);
});
// before input?
textarea.addEventListener('beforeinput', (event) => {
console.log('beforeinput', event);
});
</script> We would be super interested in hearing if Reddit’s submit page is working for you without issues. |
(Alternatively, is this feature shipping in some Edge or Chromium build where we could try it?) |
The feature was enabled in Chrome 124, so should be available in Chrome Canary, at the very least. |
@yoavweiss, do you know if maybe this is not enabled on Mac platforms? We can't get it to work (i.e., we are not seeing any predictions) on regular text areas 😢 |
It shouldn't be AFAICT. |
That's right -- Edge Canary is the thing to test with here. For clarity, there are two things being discussed in this thread that are related but not the same:
|
Ok, cool. We can try out Edge. Just to be clear, the compat/interop issues around what event(s) get fired from this feature when the user hits “tab” (or otherwise accepts a suggestion). It’s not related to the what predictive text gets suggested by different engines. We totally need to align on the events and spec something. |
With Edge's text prediction feature, no composition/input events are fired for the text prediction until it is accepted by the user (ie. the user hits "Tab"). Once the prediction is accepted, the There was a change that we made to the input events spec to specify that accepted writing suggestions should fire the
It looks like Edge text predictions are not working on Reddit too. We'll dig in and get back to you on if this is due to a compat issue or just a browser or site bug. |
Right, @sanketj, but it seems it's not web compatible. You are right that we will see "fewer compat issues" issues, but in Edge Reddit is also broken (as you pointed out): IMG_1754.MOVHitting tab does not work on Reddit☝️ the suggestion gets swallowed. |
That is definitely a bug, thanks for helping us find it! We'll look into fixing it. Overall, we're open to finding the right set/order of events that all text prediction implementations (or "inline writing suggestions" should we call them?) should follow. I will note that accepting predictive text and inserting that into the DOM is not a new pattern. IME methods like software keyboards offer predictive text too (see image below) and those have been working on the web for a long time, so I'm quite hopeful this can be implemented in a web compatible way. |
What is the issue with the HTML Standard?
Folks have been experimenting with
writingsuggestions
enabled in WebKit and have identified a number of sites that are exhibiting complications (leading to WebKit adding quirks for the following sites):Given the list above, there is a concern that
writingsuggestions
enabled by default might not be web compatible. Before we consider changing the spec to default to "off" and make this an opt-in feature, we are wondering if other implementers are seeing web compat issues too - particularly with respect to how this works with composition events.@sanketj, @dandclark, are you folks doing something different in Chromium/Edge that we need to consider standardizing to get this to work across the sites above?
Given the significant user benefits, I think it's in everyone's interest if we can keep
writingsuggestions
enabled by default… we can hopefully figure out how in a web compatible way.The text was updated successfully, but these errors were encountered: