w3c / input-events

Input Events
https://w3c.github.io/input-events/
Other
24 stars 16 forks source link

Keep native browser behavior for prevented `beforeinput` events #161

Open Comandeer opened 2 weeks ago

Comandeer commented 2 weeks ago

Sometimes user input is connected with a native browser/OS behavior, e.g.

However, RTEs often want to prevent the beforeinput events to be able to customize the input, e.g. preventing beforeinput after pressing Enter to insert a new paragraph. Such prevention disables the native browser behavior. There should be a way to keep the behavior but without the input, e.g.

Some loose ideas of how such API could work:

johanneswilm commented 6 days ago

From TPAC 2024 minutes:

w3c/input-events#161

Tomasz: When doing beforeinput cancelltion, it also cancels other related things such as autocorrect, two spaces give a perido, etc.

Sanket: We should keep to existing model. Maybe add a second APi to do auto correction. Would that fix it?

Tomasz: Only in this case.There are other things like auto-capitalization, etc.

Dan: What if you had three events?

Johannes: What if the editor doesn’t update the dom on one of the first two events? Could this not be solved with EditContext instead?

Sanket: It still makes sense to me. It only happens on specific keys. … Maybe something to put on EditContext.

Sanket: I think we need a way to trigger the autocorrect.

Dan: Same privacy issues (on Mac)

Ryosuke: At the same time we need to support this.

Johannes: Ryosuke, do you agree that it should no t be an issue in EditContext [explain]?

Ryosuke: Yes

Olli: But we also need to support this in other places - like textinput, etc.

Siye: The event should still be triggered, even if prevent default was called on an enter-event.

Dan: That is risky. We need more time. Difficult to fix without privacy issues.

RESOLUTION: We try to think about a solution. Table until next meeting.

Dan difference to spell checking: less privacy issue as the JS cannot see wha words are underlined and the user has to decide