Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ability to have a selectable prompt from the select dropdown #35

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,15 +184,16 @@ The select element requires more options (see [{{one-way-select}}](https://githu
- `optionLabelPath`
- `optionValuePath`
- `optionTargetPath`
- `includeBlank`
- `prompt`

```Handlebars
{{f.input
type = "select"
label = "Country"
name = "country"
options = countries
includeBlank = "Please choose..."
prompt = "Please choose..."
promptIsSelectable= = true
}}
```

Expand Down
25 changes: 13 additions & 12 deletions addon/templates/components/validated-input.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,19 @@
{{#if (eq type "select")}}

{{one-way-select
value = (or value (get model name))
options = options
optionLabelPath = optionLabelPath
optionValuePath = optionValuePath
optionTargetPath = optionTargetPath
name = name
class = config.css.control
update = (action "update")
focusOut = (action "setDirty")
includeBlank = includeBlank
disabled = disabled
multiple = multiple
value = (or value (get model name))
options = options
optionLabelPath = optionLabelPath
optionValuePath = optionValuePath
optionTargetPath = optionTargetPath
name = name
class = config.css.control
update = (action "update")
focusOut = (action "setDirty")
prompt = prompt
disabled = disabled
multiple = multiple
promptIsSelectable = promptIsSelectable
}}

{{else if (eq type "radioGroup")}}
Expand Down