Skip to content

Commit

Permalink
Use ensure-safe-component for dynamic invocations
Browse files Browse the repository at this point in the history
  • Loading branch information
nickschot committed Dec 30, 2023
1 parent 9cf8fe6 commit ffe795f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
7 changes: 6 additions & 1 deletion addon/components/model-select-multiple.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,12 @@
@eventType={{@eventType}}
@title={{@title}}
{{!-- @triggerClass="ember-power-select-multiple-trigger {{@triggerClass}}" --}}
@triggerComponent={{component (or @triggerComponent "power-select-multiple/trigger") tabindex=@tabindex}}
@triggerComponent={{
if
@triggerComponent
(component (ensure-safe-component @triggerComponent) tabindex=@tabindex)
(component "power-select-multiple/trigger" tabindex=@tabindex)
}}
@triggerId={{@triggerId}}
@verticalPosition={{@verticalPosition}}
@tabindex={{this.computedTabIndex}}
Expand Down
4 changes: 2 additions & 2 deletions addon/components/model-select.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
@onOpen={{this.onOpen}}
@options={{this._options}}
@optionsComponent={{component
this.optionsComponent
(ensure-safe-component this.optionsComponent)
infiniteScroll=this.infiniteScroll
infiniteModel=this.model
withCreate=this.withCreate}}
Expand All @@ -52,7 +52,7 @@
@selectedItemComponent={{@selectedItemComponent}}
@tabindex={{@tabindex}}
@triggerClass={{@triggerClass}}
@triggerComponent={{@triggerComponent}}
@triggerComponent={{ensure-safe-component @triggerComponent}}
@triggerId={{@triggerId}}
@triggerRole={{@triggerRole}}
@typeAheadMatcher={{@typeAheadMatcher}}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"prepare": "node ./compile-css.js"
},
"dependencies": {
"@embroider/util": "^1.12.1",
"@ember/test-waiters": "^2.4.5",
"@glimmer/component": "^1.1.2",
"@glimmer/tracking": "^1.1.2",
Expand Down
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ffe795f

Please sign in to comment.