Conversation
rkaraivanov
left a comment
There was a problem hiding this comment.
LGTM
Just some minor nitpicks
src/components/select/select.ts
Outdated
| import { styles as indigo } from './themes/light/select.indigo.css'; | ||
| import { styles as material } from './themes/light/select.material.css'; | ||
|
|
||
| defineComponents(IgcIconComponent, IgcSelectItemComponent); |
There was a problem hiding this comment.
I guess you can throw in the group and header components as well
| this.size = 'medium'; | ||
|
|
||
| /** Return the focus to the target element when closing the list of options. */ | ||
| this.addEventListener('igcClosing', () => this.target.focus()); |
There was a problem hiding this comment.
Since this is cancelable, do we want to move the focus when it is prevented? Maybe do it on igcClosed?
There was a problem hiding this comment.
Setting this on the igcClosed event fires an extra focus event between the closing and the closed events.
src/components/select/select.ts
Outdated
| if (!event || !event.key || event.key.length > 1 || event.key === ' ') { | ||
| // ignore longer keys ('Alt', 'ArrowDown', etc) AND spacebar (used of open/close) | ||
| return; | ||
| } |
There was a problem hiding this comment.
| if (!event || !event.key || event.key.length > 1 || event.key === ' ') { | |
| // ignore longer keys ('Alt', 'ArrowDown', etc) AND spacebar (used of open/close) | |
| return; | |
| } | |
| // `/^\p{L}|\p{N}$/u` is even more pedantic | |
| if (!/^.$/u.test(event.key)) { | |
| return; | |
| } |
|
Testing notes:
Still to test: methods, events |
|
Changing the value resets the invalid state set through the API. It probably makes sense but it's better to have the behavior in the spec as well. |
|
Method observations:
|
|
|
Ok, the other things I wanted to test look good, putting verified with the caveat that the spec needs to be updated to reflect the way navigation is implemented. Let me know when you are ready with the thing you wanted to check regarding the input validity functionality and either merge it or let me know so I can. |
The input component works the same way. Perhaps this requires further discussion but I think we should refactor all input-like components and their validity in another PR when we implement native form support for such elements. |
Closes #180