mirror of
https://github.com/prymitive/karma
synced 2026-05-07 03:26:52 +00:00
fix(ui): pass custom elements and classes instead of overriding default styles
Highlight component now takes extra props for wrapping matched part of suggestion, pass span with bold text class to mark it as bold instead of overwriting default mark element with highlight class in css
This commit is contained in:
@@ -19,9 +19,3 @@ input.components-filterinput-wrapper {
|
||||
input.components-filterinput-wrapper:focus {
|
||||
width: auto;
|
||||
}
|
||||
|
||||
/* highlighted part of the suggestion - phrase in the input that matches it */
|
||||
mark.highlight {
|
||||
padding: 0;
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
@@ -102,7 +102,15 @@ const FilterInput = observer(
|
||||
};
|
||||
|
||||
renderSuggestion = (suggestion, { query, isHighlighted }) => {
|
||||
return <Highlight search={query}>{suggestion}</Highlight>;
|
||||
return (
|
||||
<Highlight
|
||||
matchElement="span"
|
||||
matchClass="font-weight-bold"
|
||||
search={query}
|
||||
>
|
||||
{suggestion}
|
||||
</Highlight>
|
||||
);
|
||||
};
|
||||
|
||||
renderInputComponent = inputProps => {
|
||||
|
||||
Reference in New Issue
Block a user