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

LibWeb: Fire input event on user interaction with input element buttons #24347

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

tcl3
Copy link
Member

@tcl3 tcl3 commented May 17, 2024

An input event is now fired when the step up or step down button of an input element of type number is clicked.

This ensures that any associated <output> element is updated when these buttons are clicked.

Demo:

input_element_step_buttons.mp4

@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label May 17, 2024
@tcl3 tcl3 force-pushed the libweb_fire_inputevent_on_step_button_click branch 2 times, most recently from 38ea1ac to 68660f2 Compare May 18, 2024 05:10
@tcl3
Copy link
Member Author

tcl3 commented May 20, 2024

It looks like we aren't always firing change events when we should be. I think it would be a good idea to tackle that as part of this PR.

@tcl3 tcl3 marked this pull request as draft May 20, 2024 22:40
@github-actions github-actions bot removed the 👀 pr-needs-review PR needs review from a maintainer or community member label May 20, 2024
tcl3 added 4 commits May 22, 2024 21:58
Input elements without a defined user-interaction behavior need to fire
an input event when the user changes the element's value in some way.
This change moves the code to do this into its own function and adds
some spec text to explain what is being done.
An input event is now fired when the step up or step down button of an
input element of type number is clicked.

This ensures that any associated <output> element is updated when these
buttons are clicked.
This matches the behavior of other browsers. Previously, a click event
was used, so the value was only updated when the mouse was released.
This matches the behavior of other browsers.
@tcl3 tcl3 force-pushed the libweb_fire_inputevent_on_step_button_click branch from 68660f2 to 3b1d83a Compare May 22, 2024 21:01
@tcl3 tcl3 marked this pull request as ready for review May 22, 2024 21:04
@github-actions github-actions bot added the 👀 pr-needs-review PR needs review from a maintainer or community member label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
👀 pr-needs-review PR needs review from a maintainer or community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants