Warning: The magic method SFML_Singleton::__wakeup() must have public visibility in /home/public/wp-content/plugins/sf-move-login/inc/classes/class-sfml-singleton.php on line 72
ember-paper – Thoughts, etc.

Thoughts, etc.

Tracking the occasional random walk

ember-paper

Clearing an Ember Paper select component

2017-09-01 / Leave a Comment

To allow users to clear the selection of an Ember Paper {{paper-select}} component, simply pass it the  allowClear=true option:

Allowing a paper-select component to be cleared
1
2
3
4
5
6
{{#paper-select
    placeholder="Select a thing..."
    required=false
    allowClear=true
    ...
}}

This option is passed along to the ember-power-select component that ember-paper uses under the hood, so the resulting clear button can be styled accordingly. For example,

Styling the clear-selection button
Sass
1
2
3
4
.ember-power-select-clear-btn {
  position: absolute;
  right: 25px;
}

Thanks to @miguelcobain for this tip on the community Slack channel.

Posted in: front-end Tagged: ember, ember-paper