-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display issue: ReferenceInput + SelectInput + allowEmpty shows too small blank entry in select list #3909
Comments
Thank you for opening this issue. In order to confirm it, we'll have to reproduce it. https://codesandbox.io/s/github/marmelab/react-admin/tree/next/examples/simple This is the simplest way to confirm a bug is related to the React Admin codebase. |
I can't reproduce it in the simple example with the following code: // in CommentEdit.js
<ReferenceInput
source="post_id"
reference="posts"
perPage={15}
sort={{ field: 'title', order: 'ASC' }}
fullWidth
allowEmpty
>
<SelectInput
optionText="title"
options={{ fullWidth: true }}
/>
</ReferenceInput> So if there is a problem, it's either on your side, or outside of the SelectInput. Please provide a reproducible test case using the simple example CodeSandbox, as explained by Kevin. |
Sounds good. I'll try and recreate here in a sandbox if I can. Cheers! |
It is a styling problem.
Auto mode causes the calculated text height of an empty string to get 0. |
For the records: v3.0.0-alpha.3+ supports new SelectInput property Setting emptyText resolves this issue as auto height mechanism gets something to calculate on. |
agree with comments regarding UX perspective. Blank/empty item is sub-optimal. Using emptyText option is solution, particularly with SelectInput component Also from a UX perspective: when using the ReferenceInput+AutocompleteInput, it leaves the User with choice of manually selecting current choice text and clearing. Not perfect, but ok. I think we can close this. Thank for the work investigating! |
There is well a styling bug that should be fixed IMHO, regardless of any UX preference. The empty item is the default behavior provided by A fix is to set a non-breaking space in translations, but feels very hacky: import english from 'ra-language-english'
english.ra.boolean.null = ' '
// ... locale setup |
I reopen this one since I was able to reproduce it on the [example]:
|
I think trying to create a comment is the better way to reproduce the bug. Or you should pass |
I can't reproduce this with the latest version. |
Fixed in #4480 |
It looks like the same problem for AutocompleteInput. |
@PavelYzhakov Thanks, I took care of that one :) |
What you were expecting:
When using a ReferenceInput around a SelectInput where the ReferenceInput has allowEmpty set, I'd expect a blank selection choice with the same height in units as a normal/regular choice.
What happened instead:
The blank select seems to be a fraction (perhaps 10%) of the regular choice size and you can miss it actually being there and have a tester say 'where did the blank choice go', haha.
Steps to reproduce:
Other information:
See attached screenshot
If you see something in my code that makes someone say "What are you doing you fool!", please don't hesitate to comment
Environment
The text was updated successfully, but these errors were encountered: