-
Notifications
You must be signed in to change notification settings - Fork 378
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
@searchFieldPosition
argument (#1864)
* Add @searchFieldPosition argument * Add option `searchFieldPosition=trigger` for single select * Make position value strict * Add `searchFieldPosition` in docs * Fix lint * Handle blur directly in input component instead global * Fix lint * Fix input clear * Fix searchFieldPosition typing
- Loading branch information
Showing
24 changed files
with
380 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<PowerSelect | ||
@searchEnabled={{true}} | ||
@searchFieldPosition="trigger" | ||
@options={{this.diacritics}} | ||
@selected={{this.selectedDiacritic}} | ||
@labelText="Name" | ||
@onChange={{fn (mut this.selectedDiacritic)}} as |name|> | ||
{{name}} | ||
</PowerSelect> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Component from '@glimmer/component'; | ||
|
||
export default class extends Component { | ||
diacritics = ['María', 'Søren Larsen', 'João', 'Saša Jurić', 'Íñigo']; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<PowerSelectMultiple | ||
@searchEnabled={{true}} | ||
@searchFieldPosition="before-options" | ||
@options={{this.diacritics}} | ||
@selected={{this.selectedDiacritic}} | ||
@labelText="Name" | ||
@onChange={{fn (mut this.selectedDiacritic)}} as |name|> | ||
{{name}} | ||
</PowerSelectMultiple> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Component from '@glimmer/component'; | ||
|
||
export default class extends Component { | ||
diacritics = ['María', 'Søren Larsen', 'João', 'Saša Jurić', 'Íñigo']; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
ember-power-select/src/components/power-select/before-options.hbs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<div class="ember-power-select-input"> | ||
{{!-- template-lint-disable require-input-label --}} | ||
<input type="search" | ||
autocomplete="off" | ||
autocorrect="off" | ||
autocapitalize="off" | ||
spellcheck={{false}} | ||
class="ember-power-select-search-input-field" | ||
value={{@select.searchText}} | ||
role={{or @role "combobox"}} | ||
aria-activedescendant={{@ariaActiveDescendant}} | ||
aria-controls={{@listboxId}} | ||
aria-owns={{@listboxId}} | ||
aria-autocomplete="list" | ||
aria-haspopup="listbox" | ||
aria-expanded={{if @select.isOpen "true" "false"}} | ||
placeholder={{@searchPlaceholder}} | ||
aria-label={{@ariaLabel}} | ||
aria-labelledby={{@ariaLabelledBy}} | ||
aria-describedby={{@ariaDescribedBy}} | ||
{{on "input" this.handleInput}} | ||
{{on "focus" @onFocus}} | ||
{{on "blur" this.handleBlur}} | ||
{{on "keydown" this.handleKeydown}} | ||
{{this.setupInput}} | ||
> | ||
</div> |
Oops, something went wrong.