<script>
import {selectTextOnFocus, blurOnEscape} from './inputDirectives.js';
let value = 'Focus me!';
</script>
<p>Focus this input. It will automatically select all text. Pressing Escape will blur it.</p>
<input bind:value={value} use:selectTextOnFocus use:blurOnEscape/>
<p>This one will also select the text on focus, but not blur on Escape.</p>
<input bind:value={value} use:selectTextOnFocus/>
<style>
input {
border-radius: .5em;
padding: .5em 1em;
outline: none;
}
input:focus {
border-color: steelblue;
}
</style>