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

fix(slider): disabled Slider should not submit a form #1758

Merged
merged 1 commit into from
Jul 4, 2023

Conversation

SuperioOne
Copy link
Contributor

PR contains small changes for slider to improve it's behavior on form submit.

  1. Removed redundant input which causes double value submit and submit once when input is disabled.

Form data before:

{
  "FormData": [
    {
      "name": "basicSlider",
      "value": "27"
    },
    {
      "name": "basicSlider", // Data submitted twice here
      "value": "27"
    },
    {
      "name": "disableSlider", // It shouldn't submit disabled input with the form
      "value": "30"
    }
  ]
}

Form data after:

{
  "FormData": [
    {
      "name": "basicSlider",
      "value": "27"
    }
  ]
}

Tested with both hideTextInput true and false.

  1. Removed extra styling since it always sets input type to hidden when hideTextInput is true.

@metonym metonym changed the title redundant input removed from slider fix(slider): disabled Slider should not submit a form Jul 4, 2023
Copy link
Collaborator

@metonym metonym left a comment

Choose a reason for hiding this comment

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

Nice find, thanks for getting to the bottom of this.

@metonym metonym merged commit ab21c89 into carbon-design-system:master Jul 4, 2023
2 checks passed
@SuperioOne SuperioOne deleted the slider-input-fix branch July 4, 2023 20:17
@metonym
Copy link
Collaborator

metonym commented Jul 8, 2023

Fixed in v0.76.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants