Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
vue-select-on-focus
Advanced tools
Selects the text contents of inputs, textareas, and contenteditable elements on focus
Selects the text contents of inputs, textareas, and contenteditable elements on focus.
$ npm install --save vue-select-on-focus
or
$ yarn add vue-select-on-focus
or include the UMD build, hosted by unpkg in a <script>
tag.
<script src="//unpkg.com/vue-select-on-focus" />
import Vue from "vue"
import selectOnFocus from "vue-select-on-focus"
Vue.use(selectOnFocus)
import selectOnFocus from "vue-select-on-focus"
export default {
directives: { selectOnFocus },
template: "<div><input type='text' value='Lorem Ipsum' v-select-on-focus /></div>"
}
The directive will work with any text input, textarea, or contenteditable element.
If you don't want to select all the text contents, you can pass in an object with start
and end
values to the directive.
import selectOnFocus from "vue-select-on-focus"
export default {
directives: { selectOnFocus },
template: "<div><input type='text' value='Lorem Ipsum' v-select-on-focus='customRange' /></div>",
data() {
return {
customRange: {
start: 2,
end: 5
}
}
}
}
In this example the letters rem
would be selected when the input is focused.
# To run the example
$ npm run example
# To run the tests
$ npm test
# To publish the dist file
$ npm run build
MIT © Collin Henderson
FAQs
Selects the text contents of inputs, textareas, and contenteditable elements on focus
The npm package vue-select-on-focus receives a total of 0 weekly downloads. As such, vue-select-on-focus popularity was classified as not popular.
We found that vue-select-on-focus demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.