Files
threshold-ui/addons/rose/addon/helpers/set-from-event.js
T
Randall Morey b08d3affe4 refactor: 💡 update scope form to use HDS input and textarea (#1459)
* refactor: 💡 update scope form to use HDS input and textarea

* chore: 🤖 tweak "optional" label text color in dark mode

* fix: 🐛 add HDS field margins and fix form tests

* fix: 🐛 fix acceptance tests and add TextInput event handlers

* fix: 🐛 use input event and fix set-from-event to handle empty

* fix: 🐛 fix linting and add @type='text' on HDS text input

* fix: 🐛 fix HDS field margin overrides

* chore: 🤖 simplify selector
2022-11-15 08:53:10 -08:00

12 lines
400 B
JavaScript

import { helper } from '@ember/component/helper';
import { set } from '@ember/object';
export function setFromEvent([context, field]) {
// The Ember `set` function is used here because `field` may be in dotted
// notation, refering to nested fields within `context`.
return (event) =>
event?.target ? set(context, field, event.target.value) : null;
}
export default helper(setFromEvent);