Skip to content

Commit

Permalink
fix(select): reduce typeahead delay & focus selection bug (#8)
Browse files Browse the repository at this point in the history
* fix: select component delay & focus selection bug

* chore: storybook addon config
  • Loading branch information
anuraghazra authored Aug 25, 2020
1 parent 48c10fc commit 676c3e2
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
14 changes: 14 additions & 0 deletions .storybook/manager.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { addons } from "@storybook/addons";

addons.setConfig({
isFullscreen: false,
showNav: true,
showPanel: true,
panelPosition: "bottom",
sidebarAnimations: true,
enableShortcuts: false,
isToolshown: true,
theme: undefined,
initialActive: "sidebar",
showRoots: false,
});
8 changes: 5 additions & 3 deletions src/select/SelectDropdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,14 @@ const useSelectDropdown = createHook<SelectDropdownOptions, BoxHTMLProps>({
dataAttrValue.startsWith(typehead)
) {
setCurrentId(item.id);
// remain dropdown open on setSelected
setSelected(dataAttrValue, true);
move(item.id);
if (!visible) {
// remain dropdown open on setSelected
setSelected(dataAttrValue, true);
}
}
});
}, 400),
}, 150),
[typehead],
);

Expand Down

0 comments on commit 676c3e2

Please sign in to comment.