-
Notifications
You must be signed in to change notification settings - Fork 4.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UI - masked input onchange #6586
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,17 +10,18 @@ | |
| [placeholder] | <code>String</code> | <code>value</code> | The placeholder to display before the user has entered any input. | | ||
| [allowCopy] | <code>bool</code> | <code></code> | Whether or not the input should render with a copy button. | | ||
| [displayOnly] | <code>bool</code> | <code>false</code> | Whether or not to display the value as a display only `pre` element or as an input. | | ||
| [onChange] | <code>function</code> \| <code>action</code> | <code>Function.prototype</code> | A function to call when the value of the input changes. | | ||
|
||
**Example** | ||
|
||
```js | ||
<MaskedInput | ||
@value={{attr.options.defaultValue}} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. looks like the example code here got cut off! unfortunately this is one of the bugs with jsdoc2md -- it doesn't like it when components are on multiple lines. unfortunately you'll have to copy/paste the example from the component source file. womp. :/ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh no :( I'll fit that, that's rather unfortunate though |
||
@placeholder="secret" | ||
@allowCopy={{true}} | ||
/> | ||
<MaskedInput | ||
@value={{attr.options.defaultValue}} | ||
@placeholder="secret" | ||
@allowCopy={{true}} | ||
@onChange={{action "someAction"}} | ||
/> | ||
``` | ||
|
||
|
||
**See** | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the difference between the inner
action
(inside the parentheses) and outer action (inside the curly braces) here?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the outer one calls a curried version returned by the inner one, onChange just passes the value, but the inner one returns a curried setAndBroadcast with path already set.