Skip to content

Commit

Permalink
Add @rootEventType argument and set mousedown as default (#1819)
Browse files Browse the repository at this point in the history
* feat: set mousedown as default rootEventType

* docs: document @rootEventType
  • Loading branch information
ArnaudWeyts authored Jul 31, 2024
1 parent f0d3e2e commit 3fbf150
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/app/templates/public-pages/docs/api-reference.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,14 @@
open or close.
</td>
</tr>
<tr>
<td>rootEventType</td>
<td><code>string</code></td>
<td>
Defaults to <code>"mousedown"</code>. Indicates the type of event the component will be listening to
in order to close.
</td>
</tr>
<tr>
<td>matcher</td>
<td><code>function</code></td>
Expand Down
1 change: 1 addition & 0 deletions ember-power-select/src/components/power-select.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
@calculatePosition={{@calculatePosition}}
@triggerComponent={{ensure-safe-component @ebdTriggerComponent}}
@contentComponent={{ensure-safe-component @ebdContentComponent}}
@rootEventType={{or @rootEventType "mousedown"}}
as |dropdown|>
{{#let (assign dropdown (hash
selected=this.selected
Expand Down
1 change: 1 addition & 0 deletions ember-power-select/src/components/power-select.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ export interface PowerSelectArgs {
triggerClass?: string;
ariaInvalid?: string;
eventType?: string;
rootEventType?: string;
ariaDescribedBy?: string;
calculatePosition?: CalculatePosition;
ebdTriggerComponent?: string | ComponentLike<any>;
Expand Down

0 comments on commit 3fbf150

Please sign in to comment.