You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[x] bug report
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://forum.primefaces.org/viewforum.php?f=57
selectedItemTemplate(value) {
if (typeof value === "string")
return value;
else
return <React.Fragment>{value.name}</React.Fragment>;
}
You'd still get "[object Object]" when you select an item.
Expected behavior
The ts api should either specify a string as a return value.
Or, if #1296 is fixed, maybe JSX should actually be supported. Maybe the api should specify and support both JSX (as a template) and string (as a more dynamic alternative to label) as a valid return value.
Minimal reproduction of the problem with instructions
Type query into codesandbox.
Please tell us about your environment:
React version:
16.13.1.
PrimeReact version:
4.1.2.
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Tested in Firefox 74.
Language: [all | TypeScript X.X | ES6/7 | ES5]
The text was updated successfully, but these errors were encountered:
VsevolodGolovanov
changed the title
AutoComplete: selectedItemTemplate ts binding claims to expect JSX.Element in return, but actually expects a string
AutoComplete: selectedItemTemplate ts binding claims to expect JSX.Element in return, but in runtime a string is expected
Apr 6, 2020
VsevolodGolovanov
changed the title
AutoComplete: selectedItemTemplate ts binding claims to expect JSX.Element in return, but in runtime a string is expected
AutoComplete: selectedItemTemplate ts binding claims to expect JSX.Element in return, but at runtime a string is expected
Apr 6, 2020
I'm submitting a ... (check one with "x")
Codesandbox Case (Bug Reports)
https://codesandbox.io/s/primereact-test-rq9zd
https://codesandbox.io/s/primereact-test-umjwi (with #1296 workaround)
Current behavior
Actually returning JSX results in "[object Object]" in the input field when typing a query.
This is also due to #1296.
Even if you work around #1296 by doing
You'd still get "[object Object]" when you select an item.
Expected behavior
The ts api should either specify a string as a return value.
Or, if #1296 is fixed, maybe JSX should actually be supported. Maybe the api should specify and support both JSX (as a template) and string (as a more dynamic alternative to
label
) as a valid return value.Minimal reproduction of the problem with instructions
Type query into codesandbox.
Please tell us about your environment:
React version:
16.13.1.
PrimeReact version:
4.1.2.
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
Tested in Firefox 74.
Language: [all | TypeScript X.X | ES6/7 | ES5]
The text was updated successfully, but these errors were encountered: