Skip to content
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

Using "outlined" variant break Input border #6468

Closed
deluan opened this issue Jul 27, 2021 · 8 comments · Fixed by #6492
Closed

Using "outlined" variant break Input border #6468

deluan opened this issue Jul 27, 2021 · 8 comments · Fixed by #6492

Comments

@deluan
Copy link

deluan commented Jul 27, 2021

What you were expecting:
Up until version 3.15, using the "outlined" variant in Input fields worked as expected.

What happened instead:
After upgrading to 3.17, if I click on an Input that has variant='outlined', it cuts the border above the first character of the field.

Steps to reproduce:
Just click the field and you can see the border changing:

Screen.Recording.2021-07-26.at.10.01.02.PM.mov

Related code:
Just add the "outlined" variant, PostList.js:44

const postFilter = [
  <SearchInput source="q" alwaysOn variant="outlined" />, 
  <TextInput source="title" defaultValue="Qui tempore rerum et voluptates" />,
  <QuickFilter
    label="resources.posts.fields.commentable"
    source="commentable"
    defaultValue
  />
];

Code Sandbox: https://codesandbox.io/s/gracious-frog-eknfj?file=/src/posts/PostList.tsx:1093-1362

Environment

  • React-admin version: 3.17.0 (but was able to reproduce locally with 3.16.5)
  • Last version that did not exhibit the issue (if applicable): 3.15 didn't have this bug
  • React version: 17
  • Browser: Chrome Version 91.0.4472.114 (Official Build) (x86_64)
@djhi
Copy link
Collaborator

djhi commented Jul 27, 2021

Thanks for reporting. It looks like we'll have to build an input using lower levels components from MUI for the SearchInput.

@Augani
Copy link

Augani commented Aug 8, 2021

Hello @djhi , Can i take this?

@fzaninotto
Copy link
Member

@Augani #6470 already proposes a solution for this issue

@Augani
Copy link

Augani commented Aug 9, 2021

@fzaninotto ohok,seen

@fzaninotto
Copy link
Member

This issue is a regression created by #6381. The right fix is to rollback the code that causes the problem. I'll handle it.

@richardgarnier
Copy link

richardgarnier commented Nov 16, 2022

I'm still seeing this issue on 4.4. Did it break again?
In case someone needs it, here the workaround I'm currently using. I'm just replacing the <SearchInput /> by:

<TextInput
  source="q"
  alwaysOn
  label={t('ra.action.search')}
  resettable
  placeholder={t('ra.action.search')}
  InputProps={{
    endAdornment: (
      <InputAdornment position="end">
        <Search color="disabled" />
      </InputAdornment>
    ),
  }}
  size="small"
/>

The idea is to force a label, so that the empty label does not popup. Having label={false} does not work.
We could directly put the label on the SearchInput, and it would work, except for the fact that the component disallow this for seemingly no reason.

@niccmac
Copy link

niccmac commented Nov 30, 2022

This also happens in the Time Input

@fzaninotto
Copy link
Member

Could you please open a new issue with a reproduction?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment