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 value and selectedItems props stale in calciteComboboxChange handler after adding a custom value #11382

Closed
2 of 6 tasks
nwhittaker opened this issue Jan 25, 2025 · 3 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. estimate - 2 Small fix or update, may require updates to tests. impact - p0 - emergency User set priority impact status of p0 - emergency p - high Issue should be addressed in the current milestone, impacts component or core functionality

Comments

@nwhittaker
Copy link
Contributor

nwhittaker commented Jan 25, 2025

Check existing issues

Actual Behavior

Given a <calcite-combobox> with allow-custom-values enabled, typing in a custom value triggers the calciteComboboxChange event. However, in the event's handler, the target combobox's valuel and selectedItems props do not include the selected item.

Screen.Recording.2025-01-24.at.6.56.36.PM.mov

Expected Behavior

The target combobox's value and selectedItems props do include the selected item by the time the calciteComboboxChange emits.

Screen.Recording.2025-01-24.at.6.57.57.PM.mov

Reproduction Sample

https://codepen.io/nwhittaker-esri/pen/vEBQeyG

Reproduction Steps

  1. Visit the repro and open the dev tools console.
  2. Click the combobox and type in a custom value.
  3. Observe the logged combobox.value and combobox.selectedItems values do not include the item selected in step 2.

Reproduction Version

3.0.0-next.113

Relevant Info

Possibly related to #11381.

Regression?

2.13.2

Priority impact

impact - p0 - emergency

Impact

A workaround is to derive the value and selectedItems props from the combobox's child elements. However it loses the order in which values were entered, and it'd be a high level of effort to fix for every combobox instance in our code base. Requesting p0 priority as Field Maps is looking to release with Calcite 3 in a few weeks.

Calcite package

  • @esri/calcite-components
  • @esri/calcite-components-react
  • @esri/calcite-design-tokens
  • @esri/calcite-ui-icons
  • @esri/eslint-plugin-calcite-components

Esri team

ArcGIS Field Apps

@nwhittaker nwhittaker added 0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. needs triage Planning workflow - pending design/dev review. labels Jan 25, 2025
@github-actions github-actions bot added ArcGIS Field Apps Issues logged by ArcGIS Field Apps team members. impact - p0 - emergency User set priority impact status of p0 - emergency labels Jan 25, 2025
@nwhittaker nwhittaker changed the title Combobox selectedItems prop sometimes stale in calciteComboboxChange handler Combobox value and selectedItems props stale in calciteComboboxChange handler when allow-custom-values enabled Jan 27, 2025
@nwhittaker
Copy link
Contributor Author

Updated issue to clarify bug stems from using allow-custom-values and also impacts the value prop.

@nwhittaker nwhittaker changed the title Combobox value and selectedItems props stale in calciteComboboxChange handler when allow-custom-values enabled Combobox value and selectedItems props stale in calciteComboboxChange handler after adding a custom value Jan 27, 2025
@jcfranco jcfranco self-assigned this Jan 28, 2025
@jcfranco jcfranco added 2 - in development Issues that are actively being worked on. p - high Issue should be addressed in the current milestone, impacts component or core functionality estimate - 2 Small fix or update, may require updates to tests. and removed 0 - new New issues that need assignment. needs triage Planning workflow - pending design/dev review. labels Jan 28, 2025
jcfranco added a commit that referenced this issue Jan 29, 2025
)

**Related Issue:** #10731, #11382

## Summary

This updates the combobox internal state after an custom item is added.

**Note**: this also adds `createEventTimePropValuesAsserter` to help
assert on event-emit time component state.
@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 Jan 29, 2025
@github-actions github-actions bot assigned geospatialem and DitwanP and unassigned jcfranco Jan 29, 2025
Copy link
Contributor

Installed and assigned for verification.

@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 Feb 4, 2025
@geospatialem
Copy link
Member

Verified in 3.0.0-next.126:

Image

benelan pushed a commit that referenced this issue Feb 8, 2025
)

**Related Issue:** #10731, #11382

## Summary

This updates the combobox internal state after an custom item is added.

**Note**: this also adds `createEventTimePropValuesAsserter` to help
assert on event-emit time component state.
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 Field Apps Issues logged by ArcGIS Field Apps team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. estimate - 2 Small fix or update, may require updates to tests. impact - p0 - emergency User set priority impact status of p0 - emergency p - high Issue should be addressed in the current milestone, impacts component or core functionality
Projects
None yet
Development

No branches or pull requests

4 participants