Skip to content

fix(input-date-picker): allow clearing invalid date value #11937

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

Merged

Conversation

jcfranco
Copy link
Member

@jcfranco jcfranco commented Apr 11, 2025

Related Issue: #10169

Summary

Fixes issue where clearing the value failed if input was invalid/incomplete and not committed.

@github-actions github-actions bot added the bug Bug reports for broken functionality. Issues should include a reproduction of the bug. label Apr 11, 2025
@jcfranco jcfranco added the pr ready for visual snapshots Adding this label will run visual snapshot testing. label Apr 11, 2025
@jcfranco jcfranco requested a review from anveshmekala April 11, 2025 18:07
const input = await page.find("calcite-input-date-picker >>> calcite-input-text");
await inputDatePicker.callMethod("setFocus");
await inputDatePicker.type(inputValue);
await inputDatePicker.press("Escape");
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: Don't think this is required. Applies to all other tests.

const oldValue = this._value;
if (value !== oldValue) {
const valueChanged = value !== this._value;
const invalidValueCleared = value === "" && this.startInput?.value !== "";
Copy link
Contributor

Choose a reason for hiding this comment

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

If the user skip setting startInput & set an invalid value in endInput value, clearing those values wouldn't work.

Copy link
Member Author

Choose a reason for hiding this comment

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

Great catch. Fixed!

Copy link
Contributor

@anveshmekala anveshmekala left a comment

Choose a reason for hiding this comment

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

Looking good, added a few comments.

@jcfranco jcfranco requested a review from anveshmekala April 14, 2025 23:07
@jcfranco jcfranco added pr ready for visual snapshots Adding this label will run visual snapshot testing. and removed pr ready for visual snapshots Adding this label will run visual snapshot testing. labels Apr 14, 2025
Copy link
Contributor

@anveshmekala anveshmekala left a comment

Choose a reason for hiding this comment

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

LGTM! 👍

@jcfranco jcfranco merged commit c476a9f into dev Apr 15, 2025
14 checks passed
@jcfranco jcfranco deleted the jcfranco/10169-allow-clearing-intermediate-invalid-date-value branch April 15, 2025 21:50
@github-actions github-actions bot added this to the 2025-04-29 - Apr Milestone milestone Apr 15, 2025
benelan added a commit that referenced this pull request Apr 17, 2025
…gis-deps

* origin/dev: (31 commits)
  chore: add workflow manager to team issue templates (#11971)
  chore: release next
  feat(accordion-item): enhance component's interactivity states (#11935)
  chore: release next
  build(deps): update dependency lerna to v8.2.2 (#11948)
  feat(switch): enhance component's colors for a11y and usability (#11951)
  chore: release next
  ci: remove redundant test mode environment variable (#11958)
  fix(input-date-picker): allow clearing invalid date value (#11937)
  build: update browserslist db (#11946)
  feat(notice): add token for close icon and title text color (#11938)
  fix(list, block-group): fix drag handle events when lists or blocks are nested (#11816)
  chore: release next
  build(deps): update dependency vite to v5.4.18 (#11949)
  ci: default to stable tests when experimental mode is not set (#11957)
  fix(input-number): cancel arrow down event (#11956)
  refactor: tidy up (#11945)
  docs(checkbox): update icon color prop context (#11950)
  build(deps): bump node minor version (#11927)
  chore: release next
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug reports for broken functionality. Issues should include a reproduction of the bug. pr ready for visual snapshots Adding this label will run visual snapshot testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants