Inserting into list from onChange event #505
-
<SelectField
labelProps={{ children: 'Topics', className: 'sr-only' }}
selectProps={{
defaultValue: '',
placeholder: 'Select a topic',
children: (
<>
<option value="">Select a topic</option>
{topics.map(topic => (
<option key={topic.id} value={topic.id}>
{topic.name}
</option>
))}
</>
),
onChange: event => {
const topicId = event.target.value
const foundTopic = topics.find(t => t.id === topicId)
list.insert(fields.topics.name, {
defaultValue: foundTopic,
})
},
}}
/> The above insert doesn't seem to affect the ui at all, what could be the issue. I confirmed that onChange is called and the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
It looks like you are still using |
Beta Was this translation helpful? Give feedback.
-
Which ui lib are you using? |
Beta Was this translation helpful? Give feedback.
It looks like you are still using
list
export from v0. The insert method will only returns all the button props required to execute an intent. You will need to dispatch it manually using the requestIntent() helper