Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@mayagbarnes
Copy link
Collaborator

Describe your changes

Disables the "wheel" event on number inputs to avoid accidental modification of st.number_input value while scrolling

GitHub Issue Link (if applicable)

Closes #8867

Testing Plan

  • E2E Tests: ✅ Added
  • Manual Testing: ✅

@mayagbarnes mayagbarnes added security-assessment-completed Security assessment has been completed for PR change:bugfix PR contains bug fix implementation impact:users PR changes affect end users labels Mar 5, 2025
@mayagbarnes mayagbarnes marked this pull request as ready for review March 5, 2025 20:33
if (numberInput) {
// Issue #8867: Disable wheel events on the input to avoid accidental changes
// caused by scrolling.
numberInput.addEventListener("wheel", e => e.preventDefault())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know where the wheel feature is implemented? Is it in baseweb or is it a basic html number input feature?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its coming from the basic html number input

Copy link
Collaborator

@lukasmasuch lukasmasuch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@mayagbarnes mayagbarnes merged commit 6fbe492 into develop Mar 5, 2025
45 checks passed
@mayagbarnes mayagbarnes deleted the fix-8867 branch March 5, 2025 23:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:bugfix PR contains bug fix implementation impact:users PR changes affect end users security-assessment-completed Security assessment has been completed for PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Scrolling with mouse wheel also unintentionally modifies st.number_input values

3 participants