Skip to content
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

fix: Fix TimePicker filter behavior. Misc ComboBox Fixes #1139

Merged
merged 31 commits into from
May 7, 2021
Merged
Changes from 2 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
502cf55
Add disableFiltering prop
brandonlenz Apr 13, 2021
ac45cb3
Focus the selected opion on arrow down
brandonlenz Apr 13, 2021
73b116c
Scroll selected option into view on list open
brandonlenz Apr 13, 2021
f3adf24
Just set the options list to all options instead of filtering on ''
brandonlenz Apr 13, 2021
c98aaa1
Test Updates:
brandonlenz Apr 14, 2021
a76d7a0
When scrolling into view, scroll so item is at bottom
brandonlenz Apr 14, 2021
af9bd74
Match casing to USWDS
brandonlenz Apr 14, 2021
256fa24
Implement custom filtering:
brandonlenz Apr 14, 2021
eef8bfa
Fix several differences with USWDS Combobox
brandonlenz Apr 14, 2021
02e1310
Remove console.logs
brandonlenz Apr 14, 2021
a3a6797
Add TimePicker tests. Make ComboBox closestMatch always have a value
brandonlenz Apr 14, 2021
71c1ff4
Add test to verify disableFiltering does not hide items
brandonlenz Apr 14, 2021
79ac478
When no match is found and not filtering, closest is first item
brandonlenz Apr 14, 2021
fd53e86
Prevent unecessary re-renders
brandonlenz Apr 14, 2021
1782f8f
Match USWDS behavior on enter with option selected
brandonlenz Apr 14, 2021
16ef4fe
Match USWDS behavior of styling closest match if selected is not present
brandonlenz Apr 14, 2021
8a5bbab
Add test verifying exact match overwrite previous selection
brandonlenz Apr 14, 2021
ba59881
Update test name to be mrore clear
brandonlenz Apr 15, 2021
dfa994b
Update auto-scroll behavior and add tests
brandonlenz Apr 19, 2021
3a89764
Vastly simplify confusing pseudo duplicate state
brandonlenz Apr 19, 2021
684afb9
Add test confirming filters are properly reset
brandonlenz Apr 19, 2021
60ff4af
Merge branch 'main' into bl-time-picker-combo-box-filtering-1108
brandonlenz Apr 19, 2021
bd36ad3
Revert now-unecessary variable refactor
brandonlenz Apr 19, 2021
02b7d66
Merge branch 'bl-time-picker-combo-box-filtering-1108' of github.com:…
brandonlenz Apr 19, 2021
dabbbff
Merge branch 'main' into bl-time-picker-combo-box-filtering-1108
brandonlenz Apr 20, 2021
1cb0d0a
Merge branch 'main' into bl-time-picker-combo-box-filtering-1108
brandonlenz Apr 21, 2021
426e602
Merge branch 'main' into bl-time-picker-combo-box-filtering-1108
brandonlenz Apr 26, 2021
574e832
Merge branch 'main' into bl-time-picker-combo-box-filtering-1108
brandonlenz May 3, 2021
9ffac9f
Merge branch 'main' into bl-time-picker-combo-box-filtering-1108
brandonlenz May 6, 2021
71e8d80
Complete test expectation
brandonlenz May 6, 2021
7812a6d
Check for clear button to be present after blur
brandonlenz May 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/components/forms/ComboBox/ComboBox.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1014,13 +1014,16 @@ describe('ComboBox component', () => {
)

const input = getByTestId('combo-box-input')
const clearButton = getByTestId('combo-box-clear-button')
userEvent.type(input, '{backspace}')

expect(getByTestId('combo-box-clear-button')).not.toBeVisible()
expect(clearButton).not.toBeVisible()
expect(getByTestId('combo-box-option-list').children.length).toEqual(1)

fireEvent.blur(input)
expect

expect(input).toHaveValue('Avocado')
expect(clearButton).toBeVisible()
})

it('does not hijack focus while tabbing when another field has focus', () => {
Expand Down