Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
ember-autofocus-modifier
Advanced tools
Your ember component has just been rendered. Have you ever wanted to focus an element in the DOM right after that? Like focusing this lonely input on your page? Or like focusing a full-screen modal's close button?
This package wraps a modifier to autofocus an element in the DOM. It works for inputs and for other elements.
As an alternative to installing this package, you might want to consider using this snippet.
By default, it will search for the first non-disabled input in the dom node that it has been attached to.
You can specify a custom selector to target other element as the first positional parameter.
If no child is found, then it will try to focus the element itself.
<MyComponent {{autofocus}} />
<input {{autofocus}} />
Here, #input-2
will be focused as input-1
is disabled:
<form {{autofocus}}>
<input id="input-1" disabled="disabled" />
<input id="input-2" />
<button type="submit" />
</form>
Here, the autofocus will be applied to the button
<form {{autofocus "button"}}>
<input />
<input />
<button type="submit" />
</form>
Here, the autofocus will be applied to the button
<form>
<input {{autofocus}} />
<input {{autofocus}} />
<button {{autofocus}} type="submit" />
</form>
yarn add -D ember-autofocus-modifier
or
npm install --save-dev ember-autofocus-modifier
See the Contributing guide for details.
This project is licensed under the MIT License.
FAQs
Wraps a modifier to autofocus an element in the DOM.
The npm package ember-autofocus-modifier receives a total of 2,221 weekly downloads. As such, ember-autofocus-modifier popularity was classified as popular.
We found that ember-autofocus-modifier demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers 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
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.