-
Notifications
You must be signed in to change notification settings - Fork 841
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
Support parenthesis in EuiSearchBar values #2791
Support parenthesis in EuiSearchBar values #2791
Conversation
@@ -138,12 +138,13 @@ containsValue | |||
|
|||
phrase | |||
= '"' space? phrase:( | |||
phraseWord? (space phraseWord)* { return unescapeValue(text()); } | |||
(phraseWord+)? (space phraseWord+)* { return unescapeValue(text()); } |
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.
Expanding phraseWord
(below) with parenthesis support, instead of adding them to wordChar
, means that the parenthesis is grouped in a different phraseWord
than the rest of the phrase; this line's change allows multiple phaseWord
s to exist next to each other without spaces separating
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.
LGTM; tested locally.
Needs a changelog entry
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 checked out the branch, seems to work as advertised 👍
Summary
Fixes #2788
Adds support for
(
and)
inEuiSearchBar
's expressions when part of a phrase or escaped.Example
")" \(
(owner:"(" OR owner:\))
owner:"dewey (Jr)"
Parenthesis can optionally be escaped within a phrase as well:
owner:"dewey \(Jr\)"
/cc @pugnascotia for pegjs experience and @bevacqua for
EuiSearchBar
experience, as optional reviewersChecklist
- [ ] Check against all themes for compatibility in both light and dark modes- [ ] Checked in mobile- [ ] Checked in IE11 and Firefox- [ ] Props have proper autodocs- [ ] Added documentation examples- [ ] Checked for accessibility including keyboard-only and screenreader modes