Ghost/ghost/admin/app/components/gh-input-with-select/trigger.hbs
Kevin Ansfield 23c6547b5b Fixed missing outline on <GhInputWithSelect> when focused
refs https://github.com/TryGhost/Team/issues/993

- added calls to `onFocus()` and `onBlur()` arguments inside the trigger when the input is focused/blurred so that the active class is correctly applied by ember-power-select
- removed unnecessary mousedown propagation cancellation, it was a copied from `<GhTokenInput>` where extra mouse handling is necessary for buttons inside tokens
- updated `.gh-input-with-select` styles to add the border when active
2021-08-26 17:19:00 +01:00

24 lines
794 B
Handlebars

{{#if @extra.inputIcon}}
{{svg-jar @extra.inputIcon class=@extra.inputIconClass}}
{{/if}}
<input
{{did-insert this.registerInput}}
{{did-update this.closeWhenEmpty @select.results}}
{{on "input" this.handleInput}}
{{on "keydown" this.handleKeydown}}
{{on "keyup" this.handleKeyup}}
{{on "focus" this.handleFocus}}
{{on "blur" this.handleBlur}}
class="gh-input-with-select-input"
type={{or @extra.inputType "text"}}
autofocus={{@extra.autofocus}}
autocomplete="off"
autocorrect="off"
autocapitalize="off"
value={{@extra.value}}
name="selectSearchTerm" {{!-- contains "search" to prevent Safari showing autocomplete --}}
spellcheck="false"
role="combobox"
placeholder={{@placeholder}}
disabled={{@select.disabled}}
>