So how does onInputChange for Select work or is it bugged? UI Kit 2 v10

How to work with onInputChange to built an async select that displays options fetched based on users input. Sadly so far I only get this error message regardless of how I built the onInputChange function:

Error message: ‘e.replace is not a function’

Simplified example:

<Select
inputId=‘test’
onInputChange={() => { }}
options={[{ label: ‘a’, value: ‘a’ }]}
/>

Hi @WolfgangDiehl ,
have you tried to add a console statement to see what values are returned? It could give you more insight about the way the component is working.
Something like

<Select
inputId=‘test’
onInputChange={(e) => { console.log(e)}}
options={[{ label: ‘Label a’, value: ‘Value a’ }, { label: ‘Label b’, value: ‘Value b’ }]}
/>

Yes I’ve tried that all, the error message remains without giving me more insights. So I was just hoping that someone can show me a working example.

Are you sure that you want to use onInputChange()? It gives all the details of the events that happen to the Select component: set-value, menu-close, input-blur…
I just use onChange():

onChange={(s) => { if (s) setValue(s.value); else setValue(null); }}

and I must admit that I could not make it work using onInputChange().

Anybody from Atlassian who could tell us the right way to use onInputChange? @AdamMoore ?

Hi @WolfgangDiehl , I can confirm this is a bug and have raised a public ticket here: [FRGE-1368] - Ecosystem Jira . We’ll look into addressing this soon

3 Likes