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

Combobox blank after selecting the same option twice #4738

Closed
paulcpederson opened this issue Jun 15, 2022 · 22 comments
Closed

Combobox blank after selecting the same option twice #4738

paulcpederson opened this issue Jun 15, 2022 · 22 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Online Issues logged by ArcGIS Online team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. c-combobox Issues that pertain to the calcite-combobox and related components design Issues that need design consultation prior to development. estimate - 3 A day or two of work, likely requires updates to tests. has workaround Issues have a workaround available in the meantime. p - high Issue should be addressed in the current milestone, impacts component or core functionality ready for dev Issues ready for development implementation. research Issues that require more in-depth research or multiple team members to resolve or make decision.

Comments

@paulcpederson
Copy link
Member

paulcpederson commented Jun 15, 2022

Actual Behavior

When a combobox option is selected in single select mode, selecting it again does not show the option as selected. It stays blank with the text input visible.

Expected Behavior

Selecting an option should show that option as selected. This will keep the combobox consistent with calcite select and consistent internally with itself as after selecting a new option.

Reproduction Sample

https://codepen.io/paulcp/pen/abqXgqE

Reproduction Steps

  1. Open the combobox
  2. Select Altitude (already selected)

Reproduction Version

1.0.0-beta.83

Relevant Info

Looking at different versions, it seems like this has behaved very differently in different versions.

  • beta.83 the combobox will close, the input remains focused and active, and shows as blank
  • beta.81 will close the options, hide the input, but show as blank
  • beta.69 and earlier worked as expected

Regression?

1.0.0-beta.69

@paulcpederson paulcpederson added bug Bug reports for broken functionality. Issues should include a reproduction of the bug. 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Jun 15, 2022
@macandcheese
Copy link
Contributor

@paulcpederson would one of the suggestions for an additional "mode" or type of Combobox selection work here? Both UX could be desirable I think... #3074

@paulcpederson
Copy link
Member Author

This issue is exclusively tied to single select to me. In multi select I think the behavior is fine, but if I'm using single select and I select an item, I expect it to behave like a select menu. Selecting one item vs another should not have different behavior, IMO.

@macandcheese
Copy link
Contributor

macandcheese commented Jun 17, 2022

We could look at the behavior of MUI as an example - they by default have a clear affordance that is opt-out with disableClear - this could be combined with fixing the regression to solve all the requests in - #3074

Basically always prevent ability to "double click clear" in single-select, but have the clear affordance, which in your use case you would opt-out of with the prop... I think that sounds reasonable?

To summarize proposal:

  • Always display a clear "x" affordance when the combobox is populated - in single select or in multi select.
  • Add a disableClear property to allow users to opt-out of displaying that clear "x" affordance, to basically create a "single-persist" mode without needing to add another mode option

(Alternatively, opt-in to clear with clearable to match other components)

  • fix this bug as reported in single select.

@geospatialem geospatialem added enhancement Issues tied to a new feature or request. design Issues that need design consultation prior to development. labels Jul 22, 2022
@geospatialem geospatialem added this to the Sprint 07/25 - 08/05 milestone Jul 22, 2022
@geospatialem geospatialem removed the design Issues that need design consultation prior to development. label Jul 22, 2022
@benelan benelan removed the needs triage Planning workflow - pending design/dev review. label Oct 4, 2022
@benelan benelan added the ArcGIS Online Issues logged by ArcGIS Online team members. label Jan 30, 2023
@alisonailea alisonailea added airtable and removed airtable bug Bug reports for broken functionality. Issues should include a reproduction of the bug. labels Feb 28, 2023
@geospatialem geospatialem added the p - medium Issue is non core or affecting less that 60% of people using the library label Mar 3, 2023
@macandcheese macandcheese added the c-combobox Issues that pertain to the calcite-combobox and related components label Mar 22, 2023
@geospatialem geospatialem added bug Bug reports for broken functionality. Issues should include a reproduction of the bug. p - high Issue should be addressed in the current milestone, impacts component or core functionality and removed enhancement Issues tied to a new feature or request. p - medium Issue is non core or affecting less that 60% of people using the library labels Apr 5, 2023
@jcfranco
Copy link
Member

Would the goal be to have the current behavior of disableClear kick in automatically based on the selection mode then?

@jcfranco
Copy link
Member

For posterity, we'll proceed to add single-persist mode and disableClear will keep on truckin' on. 🛻

jcfranco added a commit that referenced this issue Aug 25, 2023
**Related Issue:** #4738 

## Summary

Adds `single-persist` mode to `calcite-combobox` to allow users to
opt-in to this change in selection behavior (vs making it a breaking
change on the current `single` selection mode).

`clearDisabled` will behave the same way unless we want to make an
exception to this mode.
@jcfranco jcfranco added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels Aug 25, 2023
@github-actions
Copy link
Contributor

Installed and assigned for verification.

@geospatialem
Copy link
Member

The mouse event is verified with 1.7.0-next.9, however keyboard user functionality behaves a bit differently.

@jcfranco Would we expect the same behavior for keyboard users? Here is a codepen for testing.

Elijbet pushed a commit that referenced this issue Aug 30, 2023
**Related Issue:** #4738 

## Summary

Adds `single-persist` mode to `calcite-combobox` to allow users to
opt-in to this change in selection behavior (vs making it a breaking
change on the current `single` selection mode).

`clearDisabled` will behave the same way unless we want to make an
exception to this mode.
@geospatialem geospatialem added 2 - in development Issues that are actively being worked on. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Aug 30, 2023
jcfranco added a commit that referenced this issue Aug 31, 2023
…st mode (#7634)

**Related Issue:** #4738 

## Summary

This also adds test coverage for keyboard toggling for all
selection-modes.
@jcfranco jcfranco added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels Aug 31, 2023
@github-actions
Copy link
Contributor

Installed and assigned for verification.

@github-actions github-actions bot assigned geospatialem and unassigned jcfranco Aug 31, 2023
@jcfranco
Copy link
Member

@geospatialem Forgot to focus on keyboard toggling. It should be good to go now! 🚀

@geospatialem geospatialem added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Aug 31, 2023
@geospatialem
Copy link
Member

Verified with both mouse and keyboard selections in 1.7.0-next.16.

@brittneytewks brittneytewks added the design Issues that need design consultation prior to development. label Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Online Issues logged by ArcGIS Online team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. c-combobox Issues that pertain to the calcite-combobox and related components design Issues that need design consultation prior to development. estimate - 3 A day or two of work, likely requires updates to tests. has workaround Issues have a workaround available in the meantime. p - high Issue should be addressed in the current milestone, impacts component or core functionality ready for dev Issues ready for development implementation. research Issues that require more in-depth research or multiple team members to resolve or make decision.
Projects
None yet
Development

No branches or pull requests

8 participants