Skip to content

Commit

Permalink
docs: select search field text on focus
Browse files Browse the repository at this point in the history
  • Loading branch information
iisakkirotko committed Sep 12, 2024
1 parent b617f11 commit 67573c5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions solara/website/components/algolia_api.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
@keyup.esc="close();"
@keyup.down="hoverItem = hoverItem == null ? 0 : Math.min(hoverItem + 1, results.hits.length - 1, 9)"
@keyup.up="hoverItem = hoverItem == null ? 9 : Math.max(hoverItem - 1, 0)"
@focus="selectText();"
class="algolia"
></v-text-field>
</template>
Expand Down Expand Up @@ -119,6 +120,9 @@ module.exports = {
this.$set(this.results, []);
}
},
selectText() {
this.$refs.search.$refs.input.select();
},
getSnippet( element ) {
if (element.type == "content") {
return element._highlightResult.content.value;
Expand Down

0 comments on commit 67573c5

Please sign in to comment.