-
Notifications
You must be signed in to change notification settings - Fork 78
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(input-date-picker): no longer close while navigating months with chevron actions #11525
fix(input-date-picker): no longer close while navigating months with chevron actions #11525
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
@@ -351,7 +351,13 @@ export class DatePickerMonthHeader extends LitElement { | |||
|
|||
if (isTargetLastValidMonth) { | |||
if (!this.position) { | |||
await (isDirectionLeft ? this.nextMonthAction.setFocus() : this.prevMonthAction.setFocus()); | |||
if (isDirectionLeft) { | |||
this.nextMonthAction.disabled = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you DRY this up?
const target = isDirectionLeft ? this.nextMonthAction : this.prevMonthAction;
target.disabled = false;
await target.setFocus();
@@ -351,7 +351,13 @@ export class DatePickerMonthHeader extends LitElement { | |||
|
|||
if (isTargetLastValidMonth) { | |||
if (!this.position) { | |||
await (isDirectionLeft ? this.nextMonthAction.setFocus() : this.prevMonthAction.setFocus()); | |||
if (isDirectionLeft) { | |||
this.nextMonthAction.disabled = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like disabled here is also being set in renderChevron()
. Would this conflict with that? Maybe a state property can be used here to handle disabling the action?
Should the test cover this action being disabled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would conflict with the disabled property in renderChevron( )
method. We may need two state properties to handle disable state for both actions. Could be a redo me thinks considering possible refactor.
Ideally this should be handled with component lifecyle. Tried awaiting on updateComplete but it invokes an update to the chevron action in time before the blur
is invoked & bubbled up to input-date-picker.
Open to other suggestions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the test cover this action being disabled?
Don't think its required to assert on the attribute (possibly changing the approach in refactor) and the test covers visibility of date-picker.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added issue #11591 to investigate further.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll defer to @jcfranco for approval on this one. The code seems fine but could lead to conflicts since the disabled
property is set here as well as with the VDOM on this element. It seems like only setting it via JSX is the safer route and should suffice.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll defer to @jcfranco for approval on this one. The code seems fine but could lead to conflicts since the
disabled
property is set here as well as with the VDOM on this element. It seems like only setting it via JSX is the safer route and should suffice.
Apologies i missed this before merging, had to refresh the tab for this comment to show up 😢
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anveshmekala Can you add a note to #11591 to make sure the above concern is addressed?
🤖 I have created a release *beep* *boop* --- <details><summary>@esri/calcite-components: 3.0.3</summary> ## [3.0.3](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components@3.0.2...@esri/calcite-components@3.0.3) (2025-02-19) ### Bug Fixes * **dialog, modal, popover, sheet:** Restore `focusTrapDisabled` reactiveness ([#11586](#11586)) ([a32dd7e](a32dd7e)) * **input-date-picker:** No longer close while navigating months with chevron actions ([#11525](#11525)) ([acf5824](acf5824)) * **slider:** Ensure histograms with non-zero min are displayed correctly ([#11587](#11587)) ([9bb32f6](9bb32f6)) * **tooltip:** Close tooltips on prevented pointer move events ([#11557](#11557)) ([470df20](470df20)) </details> <details><summary>@esri/calcite-components-react: 3.0.3</summary> ## [3.0.3](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-react@3.0.2...@esri/calcite-components-react@3.0.3) (2025-02-19) ### Miscellaneous Chores * **@esri/calcite-components-react:** Synchronize components versions ### Dependencies * The following workspace dependencies were updated * dependencies * @esri/calcite-components bumped from 3.0.2 to 3.0.3 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- <details><summary>@esri/calcite-components: 3.0.3</summary> [3.0.3](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components@3.0.2...@esri/calcite-components@3.0.3) (2025-02-19) * **dialog, modal, popover, sheet:** Restore `focusTrapDisabled` reactiveness ([#11586](#11586)) ([a32dd7e](a32dd7e)) * **input-date-picker:** No longer close while navigating months with chevron actions ([#11525](#11525)) ([acf5824](acf5824)) * **slider:** Ensure histograms with non-zero min are displayed correctly ([#11587](#11587)) ([9bb32f6](9bb32f6)) * **tooltip:** Close tooltips on prevented pointer move events ([#11557](#11557)) ([470df20](470df20)) </details> <details><summary>@esri/calcite-components-react: 3.0.3</summary> [3.0.3](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-react@3.0.2...@esri/calcite-components-react@3.0.3) (2025-02-19) * **@esri/calcite-components-react:** Synchronize components versions * The following workspace dependencies were updated * dependencies * @esri/calcite-components bumped from 3.0.2 to 3.0.3 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
🤖 I have created a release *beep* *boop* --- <details><summary>@esri/calcite-components: 3.0.3</summary> [3.0.3](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components@3.0.2...@esri/calcite-components@3.0.3) (2025-02-19) * **dialog, modal, popover, sheet:** Restore `focusTrapDisabled` reactiveness ([#11586](#11586)) ([a32dd7e](a32dd7e)) * **input-date-picker:** No longer close while navigating months with chevron actions ([#11525](#11525)) ([acf5824](acf5824)) * **slider:** Ensure histograms with non-zero min are displayed correctly ([#11587](#11587)) ([9bb32f6](9bb32f6)) * **tooltip:** Close tooltips on prevented pointer move events ([#11557](#11557)) ([470df20](470df20)) </details> <details><summary>@esri/calcite-components-react: 3.0.3</summary> [3.0.3](https://github.com/Esri/calcite-design-system/compare/@esri/calcite-components-react@3.0.2...@esri/calcite-components-react@3.0.3) (2025-02-19) * **@esri/calcite-components-react:** Synchronize components versions * The following workspace dependencies were updated * dependencies * @esri/calcite-components bumped from 3.0.2 to 3.0.3 </details> --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: Calcite Admin <calcite-admin@esri.com>
Related Issue: #11534
Summary
No longer close
input-date-picker
while navigating between months with chevron actions & min/max are assigned adjacent month values.