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

SearchBar has no Cancel button on iOS #3892

Open
1 task done
lsarni opened this issue Feb 28, 2024 · 3 comments
Open
1 task done

SearchBar has no Cancel button on iOS #3892

lsarni opened this issue Feb 28, 2024 · 3 comments

Comments

@lsarni
Copy link

lsarni commented Feb 28, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Explain what you did

I experienced it on my project, but the bug is visible on the example on the documentation:

import React, { useState } from 'react';
import { SearchBar } from '@rneui/themed';
import { View, Text, StyleSheet } from 'react-native';

type SearchBarComponentProps = {};

const SwitchComponent: React.FunctionComponent<SearchBarComponentProps> = () => {
const [search, setSearch] = useState("");

const updateSearch = (search) => {
  setSearch(search);
};

return (
  <View style={styles.view}>
    <SearchBar
      placeholder="Type Here..."
      onChangeText={updateSearch}
      value={search}
    />
  </View>
);
};

Expected behavior

The "Cancel" button should appear on focus on iOS, and always if showCancel is set to true.

Describe the bug

The "Cancel" button doesn't appear on focus, or when showCancel is set to true

Steps To Reproduce

1. Go to https://snack.expo.dev/@lsarni/rne-searchbar
2. Start the app on iOS
3. Write on the search bar
4. See that no cancel button shows up

Screenshots

image

Your Environment

`npx @rneui/envinfo`

Global Dependencies:

No related dependency found

Local Dependencies:

  • @rneui/base : ^4.0.0-rc.7
  • @rneui/themed : ^4.0.0-rc.7
  • expo : ^50.0.0
  • react : 18.2.0
  • react-native : 0.73.2
  • @types/react : 18.2.0
@khushal87
Copy link
Member

Screenshot 2024-03-02 at 10 40 25 AM Hey @lsarni, this is working fine as expected, even on the snack that you shared.

@khushal87
Copy link
Member

What is your version of @expo/vector-icons?

@lsarni
Copy link
Author

lsarni commented Mar 4, 2024

@khushal87 I don't mean the cross/cancel icon, which is showing correctly, but the cancel button. Like it's shown on the platform specific preview here:
image

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

No branches or pull requests

2 participants