* 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
12 lines
400 B
JavaScript
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);
|