Skip to content

[EuiSearchBar] Allow phrases with leading and trailing spaces#5514

Merged
cee-chen merged 6 commits intoelastic:mainfrom
cee-chen:search-bar-fix
Jan 6, 2022
Merged

[EuiSearchBar] Allow phrases with leading and trailing spaces#5514
cee-chen merged 6 commits intoelastic:mainfrom
cee-chen:search-bar-fix

Conversation

@cee-chen
Copy link
Contributor

@cee-chen cee-chen commented Jan 5, 2022

Summary

See elastic/kibana#122237 - filter values with leading or trailing spaces were resulting in buggy behavior within EuiSearchBar. The search bar should now correctly preserve leading and trailing spaces within phrases.

⚠️ I'm not sure if this is considered a breaking change, since based on the previous unit test, it's an intentional change in functionality from how it was before. Any thoughts?

Before

before

Notice in particular that owner:" dewey" is not removing the correct filter

After

after

Checklist

- [ ] Check against all themes for compatibility in both light and dark modes
- [ ] Checked in mobile
- [ ] Checked in Chrome, Safari, Edge, and Firefox
- [ ] Props have proper autodocs and playground toggles
- [ ] Added documentation
- [ ] Checked Code Sandbox works for any docs examples

  • Added or updated jest and cypress tests
  • Checked for breaking changes and labeled appropriately

- [ ] Checked for accessibility including keyboard-only and screenreader modes

  • A changelog entry exists and is marked appropriately

@cee-chen cee-chen added the bug label Jan 5, 2022
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5514/

@chandlerprall chandlerprall self-requested a review January 5, 2022 22:04
Copy link
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

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

Nice solve! We should mark this a breaking change as it does divert from that previous intention of dropping the white space.

Need to revert the example as well.

@cee-chen cee-chen added the breaking change PRs with breaking changes. (Don't delete - used for automation) label Jan 5, 2022
@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_5514/

@cee-chen cee-chen merged commit d4f7bfb into elastic:main Jan 6, 2022
@cee-chen cee-chen deleted the search-bar-fix branch January 6, 2022 00:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking change PRs with breaking changes. (Don't delete - used for automation)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants