File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
packages/runtime/src/widgets/Form Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @ensembleui/react-runtime " : patch
3+ ---
4+
5+ expose notFoundContent property for MultiSelect widget
Original file line number Diff line number Diff line change @@ -73,6 +73,7 @@ export type MultiSelectProps = {
7373 maxTagCount : Expression < number | "responsive" > ;
7474 /** Max tag text length to show */
7575 maxTagTextLength : Expression < number > ;
76+ notFoundContent ?: Expression < string > | { [ key : string ] : unknown } ;
7677} & EnsembleWidgetProps < MultiSelectStyles > &
7778 FormInputProps < object [ ] | string [ ] > ;
7879
@@ -269,6 +270,18 @@ const MultiSelect: React.FC<MultiSelectProps> = (props) => {
269270 < Dropdown menu = { menu } newOption = { newOption } />
270271 ) ;
271272
273+ const notFoundContentRenderer = useMemo ( ( ) => {
274+ const notFoundContent = values ?. notFoundContent ;
275+
276+ if ( ! notFoundContent ) {
277+ return "No Results" ;
278+ }
279+
280+ return isString ( notFoundContent )
281+ ? notFoundContent
282+ : EnsembleRuntime . render ( [ unwrapWidget ( notFoundContent ) ] ) ;
283+ } , [ values ?. notFoundContent ] ) ;
284+
272285 return (
273286 < >
274287 < style > { `
@@ -357,7 +370,7 @@ const MultiSelect: React.FC<MultiSelectProps> = (props) => {
357370 : undefined
358371 }
359372 mode = { values ?. allowCreateOptions ? "tags" : "multiple" }
360- notFoundContent = "No Results"
373+ notFoundContent = { notFoundContentRenderer }
361374 onChange = { handleChange }
362375 onSearch = { handleSearch } // required for display new custom option with Dropdown element
363376 optionFilterProp = "children"
You can’t perform that action at this time.
0 commit comments