react-native-paper icon indicating copy to clipboard operation
react-native-paper copied to clipboard

Where is the onClearIconPress on Searchbar component?

Open d8vjork opened this issue 2 years ago • 6 comments

Ask your Question

image image

Seems like this prop type is missing from Searchbar but the documentation says otherwise:

https://callstack.github.io/react-native-paper/docs/components/Searchbar

Btw I'm using React Native Paper v5 (docs are in the same version)

d8vjork avatar Dec 01 '23 14:12 d8vjork

Also when added this breaks the onIconPress and onEndEditing

d8vjork avatar Dec 01 '23 14:12 d8vjork

Hej @d8vjork, which library version exactly you are using?

Also when added this breaks the onIconPress and onEndEditing

Could you please elaborate on it?

lukewalczak avatar Dec 11 '23 19:12 lukewalczak

@lukewalczak As described:

Btw I'm using React Native Paper v5 (docs are in the same version)

I was trying to modify the behaviour of this clear icon so it clear the search list but managed to sort of workaround this with the following:

image

My thought was: Why this is in the v5 docs but nothing related in the v5 codebase?

d8vjork avatar Dec 18 '23 10:12 d8vjork

Are you able to create sample repo with your bug reproduction? The onClearIconPress is used in our example and there is no issue with it, so wondering what can be wrong 🤔

lukewalczak avatar Dec 19 '23 19:12 lukewalczak

@lukewalczak Sorry! Didn't manage to have time for this so I just shortcut the issue in some way

Now the issue I've is within same component but with its style, as 5.x documentation says there is a mode prop on the Searchbar component...

The problem is that my Expo based application at production builds shows different than dev builds (see screenshot below).

telegram-cloud-photo-size-4-5999064075872617270-y

d8vjork avatar Mar 06 '24 10:03 d8vjork

I wrote down on this Gist what I've so far that could be relevant (theme is customised as documentation says) and using MD3 so should be fine as it is on production builds but locally seems to use a completely different styling?

d8vjork avatar Mar 06 '24 10:03 d8vjork