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

Move SearchIcon to the left #84

Open
chaos87 opened this issue Sep 11, 2020 · 2 comments
Open

Move SearchIcon to the left #84

chaos87 opened this issue Sep 11, 2020 · 2 comments

Comments

@chaos87
Copy link

chaos87 commented Sep 11, 2020

Hi there,

First, thanks for the search bar, it works great for my use case!

One thing troubles me a tiny bit, I would like to move the Search Icon to the left side of the bar while keeping the Clear Icon on the right side. Now both Clear Icon and Search Icon are on the right side and they overlap each other rendering search icon useless when user inputs something.

I'm pretty sure it should be an easy code change, but have not been able to achieve it.

Thanks!

@jersrej
Copy link

jersrej commented Nov 6, 2020

+1 for this

@rofrol
Copy link

rofrol commented Mar 5, 2021

You can try with

  searchIconButton: {
    display: 'none'
  },

and add search icon on the left

or

const useStyles = makeStyles((theme) => ({
  searchContainer: {
    order: 2,
    border: '1px solid green'
  },
  searchIconButton: {
    order: 1,
    '& + *': { /* to select clear icon button */
      border: '1px solid pink',
      order: 2
    }
  }
}
 
return <SearchBar classes={{ searchContainer: classes.searchContainer, searchIconButton: classes.searchIconButton }} />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants