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

[EuiDualRange] Fix incorrect input min/max values when empty string values exist #7767

Merged
merged 2 commits into from
May 16, 2024

Conversation

cee-chen
Copy link
Contributor

@cee-chen cee-chen commented May 16, 2024

Summary

closes #7764

Before After
invalid valid

Number('') evals to 0 which is why the bug was happening. The new code checks for value === '' and more manually falls back to the min/max if so. Sadly we can't DRY this out in the getter because the getter is used too many other places / we do actually need to render '' for the value.

Added a unit regression test to check for the correct applied min/max props when values are empty strings.

QA

General checklist

  • Browser QA
    • Checked for accessibility including keyboard-only and screenreader modes - VO reads out NaN for empty inputs which is the same as production
  • Docs site QA - N/A, bugfix
  • Code quality checklist
  • Release checklist
    • A changelog entry exists and is marked appropriately.
      - [ ] If applicable, added the breaking change issue label (and filled out the breaking change checklist)
  • Designer checklist - N/A

cee-chen added 2 commits May 16, 2024 11:05
`Number('')` evals to `0` which is why the bug was previously happening
@cee-chen cee-chen changed the title Fix incorrect min/max values for empty string values [EuiDualRange] Fix incorrect min/max values for empty string values May 16, 2024
@cee-chen cee-chen changed the title [EuiDualRange] Fix incorrect min/max values for empty string values [EuiDualRange] Fix incorrect input min/max values when empty string values exist May 16, 2024
@kibanamachine
Copy link

Preview staging links for this PR:

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

@cee-chen cee-chen marked this pull request as ready for review May 16, 2024 19:28
@cee-chen cee-chen requested a review from a team as a code owner May 16, 2024 19:28
Copy link
Contributor

@1Copenut 1Copenut left a comment

Choose a reason for hiding this comment

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

👍 I tested the manual QA with all four evergreen browsers. All behaved correctly per the updated spec.

@cee-chen
Copy link
Contributor Author

Thanks Trevor!

@cee-chen cee-chen merged commit 1b9c4d5 into elastic:main May 16, 2024
6 checks passed
@cee-chen cee-chen deleted the dual-range/empty-fix branch May 16, 2024 20:41
mgadewoll added a commit to elastic/kibana that referenced this pull request May 22, 2024
`v94.5.0-backport.1` ⏩ `v94.5.1`

[Questions? Please see our Kibana upgrade
FAQ.](https://github.com/elastic/eui/blob/main/wiki/eui-team-processes/upgrading-kibana.md#faq-for-kibana-teams)

---

## [`v94.5.1`](https://github.com/elastic/eui/releases/v94.5.1)

**Bug fixes**

- Fixed an `EuiDualRange`s with `showInput` bug, where `min`/`max`
values and invalid states were not being correctly set if values were
empty strings ([#7767](elastic/eui#7767))

**Accessibility**

- Improved `EuiDatePicker` and `EuiSuperDatePicker`'s time selection
screen reader UX ([#7726](elastic/eui#7726))
- Improved the accessibility of `EuiDatePicker` by providing full
screen-reader-only week day names to the calendar header
([#7748](elastic/eui#7748))
- Improved `EuiBadge`'s ability to tell when text within the badge is
selected/highlighted and selection color contrast
([#7752](elastic/eui#7752))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[EuiDualRange] Upper value isn't allowed to be blank
4 participants