
Product
Introducing Socket Firewall: Free, Proactive Protection for Your Software Supply Chain
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
ember-one-way-input
Advanced tools
Credit: @rwjblue's twiddle
Demo: http://ember-twiddle.com/2d7246875098d0dbb4a4
This addon provides a simple one way input that sends an update
action when it is updated, and can be used like any other input.
{{one-way-input
value=currentValue
update=(action (mut currentValue))
onenter=(action "commit")
onescape=(action "escape")
}}
The input can also be used as a checkbox:
{{one-way-input
type="checkbox"
checked=currentValue
update=(action (mut currentValue))
}}
The component's KEY_EVENTS
attribute can be overwritten to provide custom handlers for various keycodes on the keyUp
event.
KEY_EVENTS: {
'13': 'onenter',
'27': 'onescape'
}
This means that the onenter
and onescape
actions will fire if their corresponding key codes are received in the keyUp
event.
With Glimmer landing in 1.13.x, native <input>
elements can now be used in your apps, without the two way binding semantics of the {{input}}
helper. Shifting to one way bindings ("data down, actions up") makes your app easier to reason about and debug, and is generally the idiomatic way of building Ember apps going forward.
Unfortunately, there is a small gotcha with using a native input like so:
<input
value={{currentValue}}
oninput={{action (mut currentValue) value="target.value"}}
>
In the following demo, move your cursor to a character in the middle of the value, and attempt to input new text. You will notice that your cursor immediately jumps to the end of the string, which is entirely unintuitive and annoying.
This addon fixes the cursor jumping issue by using readDOMAttr
, which provides a way to read an element's attribute and update the last value Ember knows about at the same time. This makes setting an attribute idempotent.
This addon will work on Ember versions 1.13.x
and up.
git clone
this repositorynpm install
bower install
ember server
ember test
ember test --server
ember build
For more information on using ember-cli, visit http://www.ember-cli.com/.
DockYard, Inc © 2015
FAQs
Native one way input
The npm package ember-one-way-input receives a total of 15 weekly downloads. As such, ember-one-way-input popularity was classified as not popular.
We found that ember-one-way-input demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.