Commit Graph

40 Commits

Author SHA1 Message Date
Tom Southall
9282c4b7ef If the text prop is supplied and a matching item is found, onSelect is automatically fired 2022-05-19 15:41:43 +01:00
Tom Southall
a92e414eb2 Changing styles prop now triggers a re-render 2022-05-13 15:55:18 +01:00
Tom Southall
2b1bd141fa Expose DOM methods via a forwarded ref 2022-04-06 22:27:33 +01:00
Tom Southall
c1d53e1d2b Allow functions for listbox and defaultListbox props
Extend listbox and defaultListbox prop types to allow functions returning a promise resolving to an array of group settings
2022-04-02 23:35:52 +01:00
Tom Southall
7018a8835e Fix issue affecting various keypresses when search box is empty 2022-03-25 16:34:32 +00:00
Tom Southall
dcc7bfb640 Add enterKeyHint prop 2022-03-24 12:14:42 +00:00
Tom Southall
238080b01f Use autofocus HTML attribute instead of a useEffect hook 2022-03-15 14:13:49 +00:00
Tom Southall
c762a77c76 Ensure a no-items message is displayed if a query is entered but no items have ever been loaded 2022-03-15 13:20:15 +00:00
Tom Southall
cf28dacd35 Only show a transparent background on input box if there is no typeahead 2022-03-15 12:36:24 +00:00
Tom Southall
2dcdfb5887 More robust checking for typeahead presence 2022-03-11 22:01:45 +00:00
Tom Southall
9c98b30e16 Do not show typeahead unless there is more than one item in the listbox 2022-03-11 21:05:51 +00:00
Tom Southall
78a2e83662 Apply special inputFocus and containerFocus classes only if supplied, otherwise fall back to input and container classes. 2022-03-04 18:08:02 +00:00
Tom Southall
ce93a589ed Add input className 2022-03-04 16:11:06 +00:00
Tom Southall
1e70e1e2f2 Allow turning off typeahead via a prop 2022-03-04 15:35:26 +00:00
Tom Southall
4875590575 Add onFocus and onBlur props 2022-03-04 15:18:48 +00:00
Tom Southall
7432818a22 Allow mobile search behaviour
Make focus/blur more robust

Allow Clear and Cancel button contents to be passed as components
2022-03-03 23:48:26 +00:00
Tom Southall
3a8b0ba4ff Add useSWR error handling, errorMessage prop and errorbox component 2022-02-25 00:26:44 +00:00
Tom Southall
1deef54576 Correctly handle clearing search input 2022-02-24 14:22:44 +00:00
Tom Southall
583726fcb9 Consolidate itemGroups and data props into a single listbox prop 2022-02-21 21:07:52 +00:00
Tom Southall
ac6f749762 Make ListBox one word: Listbox 2022-02-21 20:08:03 +00:00
Tom Southall
464459435d Fix broken tests 2022-02-21 18:46:53 +00:00
Tom Southall
d66a2f413d Simplify rules for whether listbox is expanded 2022-02-21 16:42:55 +00:00
Tom Southall
cde5b0a91b Rename Items component as ListBox 2022-02-20 22:13:45 +00:00
Tom Southall
4a5d0b0ad4 Add disabled prop to replace isDisabled 2022-02-20 21:51:12 +00:00
Tom Southall
9484556d65 First pass at some integration tests 2022-02-19 22:20:39 +00:00
Tom Southall
ec8a714f73 Fix bug preventing clear button from working 2022-02-19 17:24:09 +00:00
Tom Southall
d14bd62aeb Add ARIA accessbility attributes to elements 2022-02-19 17:09:45 +00:00
Tom Southall
4e0e05635a Add useSelected hook 2022-02-17 22:39:33 +00:00
Tom Southall
7fc85cac8b Remove redundant variables 2022-02-17 21:16:15 +00:00
Tom Southall
3488c2951c Add useHighlight hook 2022-02-17 21:14:56 +00:00
Tom Southall
fc76372086 Remove loading feature 2022-02-17 20:33:56 +00:00
Tom Southall
ea835df0e4 Add useItemsState hook
Store props in state

Enforce minimum of 1 for minQueryLength prop
2022-02-17 19:47:44 +00:00
Tom Southall
c110222c9d Move customStyles and splitChar to global state 2022-02-17 15:45:42 +00:00
Tom Southall
6954154ee0 Add selected to global state 2022-02-17 14:27:14 +00:00
Tom Southall
a7f7a497c0 Rename context provider 2022-02-17 14:11:50 +00:00
Tom Southall
7783080796 Fix tests broken due to refactor 2022-02-17 14:06:51 +00:00
Tom Southall
61a804f593 Begin to refactor towards a global state context 2022-02-17 01:36:53 +00:00
Tom Southall
e9135f06e7 Refactor queryMatchesTypeahead and add tests 2022-02-16 19:26:15 +00:00
Tom Southall
067a9e9cb8 Start to separate out and test container useEffect hooks 2022-02-16 16:46:01 +00:00
Tom Southall
5564a45bf6 First pass at some tests 2022-02-14 20:23:31 +00:00