x
1
<input type="text" name="autoselect" id="autoselect" value="change me" class="input" autofocus="autofocus" data-controller="autoselect" />
1
<%= text_field_tag "autoselect", "change me", class: "input", autofocus: true, data: { controller: "autoselect" } %>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
.btn--copied img { animation: var(--animate-fade-out), var(--animate-slide-out-up); animation-duration: var(--time-500);}.btn--revealed img { background-image: url("off.svg"); background-size: cover;}.input--clearable { input::-webkit-search-cancel-button { display: none; } &:has(:placeholder-shown) > button { display: none; }}
Java Script is not required or multiple files are needed, check the notes.
The javascript is avilable at autoselect_controller.js