-
Notifications
You must be signed in to change notification settings - Fork 0
Additions: add clear button in core + add selected item support #146
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
Conversation
packages/core/src/input/input.js
Outdated
@@ -22,6 +24,11 @@ const Input = props => { | |||
value={searchTerm} | |||
onChange={onInputChange} | |||
/> | |||
{searchTerm !== "" && ( | |||
<span css={getStyles("clearInput", props)} onClick={onInputChange}> |
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 think this should be a button element, not a span.
It's intended for a click.
packages/core/src/item/item.js
Outdated
@@ -6,6 +6,7 @@ import SearchedItem from "./searched_item/searched_item"; | |||
import BasicItem from "./basic_item"; | |||
|
|||
export const ForwardIconRenderer = () => <>➡️</>; | |||
const defaultSelectedItem = { item: [], leaf: "" }; |
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.
Shouldn't the default be undefined? Nothing selected.
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.
Even when nothing is selected I check if selectedItem equals to the current item that renders.
I'm using toString to check if the arrays are equal so I need to give a default that is different them undefined
d5ef1c0
to
9674229
Compare
TODO - update README about selectedItem and remove markSelectedItem
1. Add clear button to core input:

2. Mark selected item (core + material):




basic mode:
search mode:
📦 Published PR as canary version:
Canary Versions
✨ Test out this PR locally via: