-
Notifications
You must be signed in to change notification settings - Fork 55
fix(Dropdown): properly accept id on searchInput from Form #1938
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1938 +/- ##
=========================================
- Coverage 70.4% 70.4% -0.01%
=========================================
Files 892 892
Lines 7867 7870 +3
Branches 2295 2298 +3
=========================================
+ Hits 5539 5541 +2
- Misses 2315 2316 +1
Partials 13 13
Continue to review full report at Codecov.
|
CHANGELOG.md
Outdated
@@ -25,6 +25,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm | |||
- Fix `CreateShorthandOptions` should be typed @lucivpav ([#1886](https://github.com/stardust-ui/react/pull/1886)) | |||
- Add `shadowLevel1Dark` in Teams themes @notandrew ([#1887](https://github.com/stardust-ui/react/pull/1887)) | |||
- When merging themes use deep merge for site and component variables @miroslavstastny ([#1907](https://github.com/stardust-ui/react/pull/1907)) | |||
- Fix `Dropdown` to properly accept `id` on `searchInpiut` @silviuavram ([#1938](https://github.com/stardust-ui/react/pull/1938)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Fix `Dropdown` to properly accept `id` on `searchInpiut` @silviuavram ([#1938](https://github.com/stardust-ui/react/pull/1938)) | |
- Fix `Dropdown` to properly accept `id` on `searchInput` @silviuavram ([#1938](https://github.com/stardust-ui/react/pull/1938)) |
Typo
docs/src/examples/components/Form/Usage/FormExampleDropdown.shorthand.tsx
Show resolved
Hide resolved
@@ -431,6 +431,7 @@ class Dropdown extends AutoControlledComponent<WithAsProp<DropdownProps>, Dropdo | |||
onStateChange={this.handleStateChange} | |||
labelId={this.props['aria-labelledby']} | |||
environment={this.context.target.defaultView} | |||
inputId={this.props.searchInput ? this.props.searchInput['id'] : undefined} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<Dropdown searchInput={render => render('boo')} />
<Dropdown searchInput='Oops' />
This thing is pretty fragile. Do we have other options?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you are right, I need to add another check. this will only work if searchInput
is an object.
pass
searchInput.id
toDownshift's
propinputId
.fix the Form + Dropdown example to make the searcInput focusable on label click.