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

Always hide remove button if no value is selected #744

Merged
merged 1 commit into from
Nov 12, 2019

Conversation

bronzehedwick
Copy link

Description

In some cases, the remove item X button is not hidden when there is no
selection made from the dropdown. This is not as usable, since there's
no item to clear, hence an effective noop.

The condition I saw seeing this issue arise is in single selects with
a placeholder value, a selection has been made, and then cleared: the
button HTML remains.

To fix, add some styles to hide the button if the select doesn't have a
value selected, in this case keying off of it's parents data-value
property.

fixes #684

Screenshots (if appropriate)

Types of changes

  • Chore (tooling change or documentation change)
  • Refactor (non-breaking change which maintains existing functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

In some cases, the remove item X button is not hidden when there is no
selection made from the dropdown. This is not as usable, since there's
no item to clear, hence an effective noop.

The condition I saw seeing this issue arise is in single selects with
a placeholder value, a selection has been made, and then cleared: the
button HTML remains.

To fix, add some styles to hide the button if the select doesn't have a
value selected, in this case keying off of it's parents `data-value`
property.

fixes Choices-js#684
@bronzehedwick
Copy link
Author

@jshjohnson Not sure why the selenium tests are failing, the error messages are pretty vague. Do you have any insight here? Thanks.

@jshjohnson
Copy link
Collaborator

@jshjohnson Not sure why the selenium tests are failing, the error messages are pretty vague. Do you have any insight here? Thanks.

I wouldn't worry about that - Github has made some changes to the macOS-latest image which is causing problems with CI 👍

@jshjohnson jshjohnson merged commit f745be4 into Choices-js:master Nov 12, 2019
@jshjohnson jshjohnson added the bugfix Pull request that fixes an existing bug label Nov 12, 2019
@jshjohnson
Copy link
Collaborator

Thanks @bronzehedwick 👍

@bronzehedwick bronzehedwick deleted the hide-remove-button branch November 12, 2019 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix Pull request that fixes an existing bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only show clear results x when there's input to clear
2 participants