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

[select] Add query to itemRenderer props #2245

Merged
merged 3 commits into from
Mar 15, 2018

Conversation

reiv
Copy link
Contributor

@reiv reiv commented Mar 15, 2018

Fixes #2239

Changes proposed in this pull request:

This PR adds query to the props passed to itemRenderer, making it possible to implement text highlighting. The Select docs example now makes use of this.

Screenshot

starwars

@reiv
Copy link
Contributor Author

reiv commented Mar 15, 2018

Update Select example with query text highlighting

Preview: documentation | landing | table

Copy link
Contributor

@giladgray giladgray left a 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>);
Copy link
Contributor

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

Copy link
Contributor Author

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) {
Copy link
Contributor

Choose a reason for hiding this comment

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

escapeRegExpChars?

@giladgray
Copy link
Contributor

@reiv addressed my comments, will merge after build 👍 👍

@reiv
Copy link
Contributor Author

reiv commented Mar 15, 2018

renames

Preview: documentation | landing | table

@giladgray giladgray merged commit 62aed90 into palantir:develop Mar 15, 2018
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.

2 participants