Skip to content

Commit

Permalink
fix: escape works now and fixed minor things
Browse files Browse the repository at this point in the history
  • Loading branch information
Cayla Hamann committed Jun 25, 2020
1 parent de40df6 commit eebf794
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/components/FeatherIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const FeatherIcon = ({ className, name, size = '1em' }) => {
) : null;
};

// Icons from
// Icons from https://feathericons.com/
const ICONS = {
'book-open': (
<>
Expand Down
19 changes: 11 additions & 8 deletions src/components/SearchInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,22 @@ const SearchInput = ({ className, onClear, value, ...props }) => {
};
return (
<div className={cx(styles.container, className)}>
<input value={value} {...props} className={styles.input} type="text" />
<span
<input
value={value}
{...props}
className={styles.input}
type="text"
onKeyDown={handleKeyDown}
/>
<div
role="button"
tabIndex={0}
onKeyDown={handleKeyDown}
onClick={handleClick}
className={styles.clearButton}
onKeyDown={(e) => e.preventDefault()}
>
<FeatherIcon
name={value !== '' ? 'x' : 'search'}
className={styles.icon}
/>
</span>
<FeatherIcon name={value ? 'x' : 'search'} className={styles.icon} />
</div>
</div>
);
};
Expand Down

0 comments on commit eebf794

Please sign in to comment.