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

Make autocomplete similar to paper-input (required star & passThru hash) #563

Merged
Merged
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
20 changes: 19 additions & 1 deletion app/templates/components/paper-autocomplete-trigger.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
label=extra.label
value=text
flex=true
required=(readonly required)
passThru=(readonly passThru)
validationErrorMessages=(readonly validationErrorMessages)
disabled=(readonly disabled)
onChange=(action "handleInputLocal")
Expand All @@ -20,7 +22,23 @@
onblur={{action onBlur}}
onkeydown={{action "handleKeydown"}}
disabled={{readonly disabled}}
onmousedown={{action "stopPropagation"}}>
onmousedown={{action "stopPropagation"}}

accept={{passThru.accept}}
autocomplete={{passThru.autocomplete}}
autosave={{passThru.autosave}}
form={{passThru.form}}
formaction={{passThru.formaction}}
formenctype={{passThru.formenctype}}
formmethod={{passThru.formmethod}}
formnovalidate={{passThru.formnovalidate}}
formtarget={{passThru.formtarget}}
inputmode={{passThru.inputmode}}
pattern={{passThru.pattern}}
readonly={{passThru.readonly}}
selectionDirection={{passThru.selectionDirection}}
spellcheck={{passThru.spellcheck}}
step={{passThru.step}}>
{{/if}}
{{#if (and select.loading select.isActive)}}
{{paper-progress-linear classNameBindings="extra.label:md-inline"}}
Expand Down
2 changes: 2 additions & 0 deletions app/templates/components/paper-autocomplete.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
label=label}}
{{#component triggerComponent
allowClear=(readonly allowClear)
required=(readonly required)
passThru=(readonly passThru)
class="layout-row"
flex=(readonly flex)
disabled=disabled
Expand Down
7 changes: 7 additions & 0 deletions tests/dummy/app/templates/demo/autocomplete.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@
{{paper-input label="Name" value=name onChange=(action (mut name)) class="flex"}}
{{#paper-autocomplete
disabled=(readonly disabled2)
required=(readonly isRequired)
triggerClass="flex"
options=items
selected=selectedCountry2
Expand All @@ -112,6 +113,7 @@
searchText=select.searchText
flags="i"}}
{{/paper-autocomplete}}

{{! END-SNIPPET }}
</div>
<p>
Expand All @@ -131,6 +133,11 @@
onChange=(action (mut simulateQuery2))}}
Simulate query
{{/paper-checkbox}}
{{#paper-checkbox
value=isRequired
onChange=(action (mut isRequired))}}
Is required
{{/paper-checkbox}}

<h3>Template</h3>
{{code-snippet name="autocomplete.floating-label.hbs"}}
Expand Down