Closed martinpengellyphillips closed 2 months ago
Could this also address https://github.com/thisbeyond/solid-select/pull/40 in that an additional context parameter can be passed to allow implementation to determine if it is a create label or not?
{ labeler: (value: any, mode: 'default' | 'create') => mode === 'create' ? <>Make <mark>{value}</mark></> : value }
Example of solving #40 with the committed approach:
createOptions(..., {format: (value, type, meta) => <>{meta.prefix && "Créer "}{value}</>}
Release 0.15.0 has now been published which should address this.
If you want to customise the display label whilst using
createOptions
you have to copy the whole function and alter the code. Currently you can only pass akey
to index into an option. It would be more useful to pass in a function to return the label to use (effectively every call togetLabel
increateOptions
).Example of how it would look: