-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
[select] Add query to itemRenderer props #2245
Conversation
Update Select example with query text highlightingPreview: documentation | landing | table |
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 is awesome!
if (before.length > 0) { | ||
tokens.push(before); | ||
} | ||
tokens.push(<span style={{ fontWeight: "bold" }}>{match[0]}</span>); |
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.
use <strong>
tag instead please
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.
Good call. I completely forgot that <strong>
was a thing. 🤦
return tokens; | ||
} | ||
|
||
function regexEscape(text: string) { |
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.
escapeRegExpChars
?
@reiv addressed my comments, will merge after build 👍 👍 |
renamesPreview: documentation | landing | table |
Fixes #2239
Changes proposed in this pull request:
This PR adds
query
to the props passed toitemRenderer
, making it possible to implement text highlighting. TheSelect
docs example now makes use of this.Screenshot