Giter Site home page Giter Site logo

Comments (11)

tboba avatar tboba commented on May 27, 2024 1

Hi @Duell10111, could you check if the change from this PR works properly for you?
Change in your package.json version of react-native-screens to:

"react-native-screens": "software-mansion/react-native-screens#@tboba/fix-tvos-search-bar"

Cheers!

from react-native-screens.

tboba avatar tboba commented on May 27, 2024 1

Hey @Duell10111, just wanted to note here that I still haven't managed to resolve the problem with missing search bar yet.
I just resolved this issue, since it was addressing the crash in TVOS, so here I recommend to still use the alternative with the imitation of the search bar, but I've opened a draft with my tryings there - #2055

I'll try to fully resolve this PR in free time, but for now it seems to be larger than I expected 😅 Of course if you're feeling strong enough, you can try to implement the idea I've mentioned there!

from react-native-screens.

Duell10111 avatar Duell10111 commented on May 27, 2024 1

Hey @tboba,
thanks for the information and your effort to resolve the problem.
I tried to create a expo module library which allow the usage of a TVOS Searchbar as a Component in React.
Maybe as further inspiration, as this seems to work fine on my case.
https://github.com/Duell10111/rn-native-search-bar/tree/beta

But of course it would be great if react-native-screens would provide this functionallity.
Unfortunately I am not really into Objective C and do not have the knowledge how this library really works. 😅

from react-native-screens.

tboba avatar tboba commented on May 27, 2024

Hi, thanks for submitting this issue! I can confirm this issue is reproducible for me.

from react-native-screens.

Duell10111 avatar Duell10111 commented on May 27, 2024

Hi @tboba,
thanks for the quick fix, the crash is not happening anymore with your PR. :)

One question from my side is that on an iPhone the Native Search Bar is visible at the top in the header, where as on tvOS nothing is shown.
This could be some enduser issue from my side or how should the native search bar look like on tvOS. 😅

iPhone:
image
tvOS:
image
(Nothing shown except the header title)

from react-native-screens.

tboba avatar tboba commented on May 27, 2024

@Duell10111 in my case when I'm opening your repro in Apple TV Simulator (iOS 17.2) I have a search bar that looks like this:
image

Hence I'm concerned on which device are you testing your app - is it a simulator or a physical TVOS device? Also, do you have some reference how the header with a search should look like (from a native iOS app or from some already existing apps)?

from react-native-screens.

Duell10111 avatar Duell10111 commented on May 27, 2024

Hey I am currently still testing in a simulator.
The searchbar you see in the repostiory is a normal textfield as fallback as the native SearchBar is not working atm.

Normally the searchbar on tvOS should look like this.
image

from react-native-screens.

tboba avatar tboba commented on May 27, 2024

@Duell10111 sorry for long response, I want to come back to this topic!
Hm, that's interesting. I tried to re-download the example project and add the patch I've mentioned above. In my case, everything is alright (I don't have any label that is a fallback for the search bar or something like that). Could you check if you don't have some platform-specific conditions set?

8mb.video-uyx-WmV5MHyY.mp4

If it still doesn't work in your case, do you maybe have some code references of the native implementation of the search bar on TVOS?
I know that it's possible to add custom searchResultsController but I don't really want to style it for now (maybe we should in the future, as an option of the screen's search bar?).

from react-native-screens.

Duell10111 avatar Duell10111 commented on May 27, 2024

Hi @tboba,

I updated the example to remove the old search bar to prevent any irritations.
I added in a sample app the searchbar via a UISearchContainerViewController to a UIView to get the corresponding view as seen in my previous version as it seemed that this is nessessary for tvOS 😅.

A further question from me is if the search controller is even added to the header on tvOS as it is done on iOS.
The header seems a bit odd for a tvOS variant IMHO. :)

from react-native-screens.

tboba avatar tboba commented on May 27, 2024

@Duell10111 thanks! Interesting, do you still have that repro with a search bar via UISearchContainerViewController? Right now I'm trying to experiment with the passed searchResultsController, but for now I can't see any search bar on TVOS 🤔

from react-native-screens.

Duell10111 avatar Duell10111 commented on May 27, 2024

Hi @tboba,
yes I tested it with an example library i created for testing.
Here I defined the SearchContainerViewController:
https://github.com/Duell10111/rn-search-bar/blob/6267576621c1b36e5dab9ac8ebeec1e76326a13f/ios/RnSearchBarViewManager.swift#L43

You can test it with the exampleTVOS added in this repository:
https://github.com/Duell10111/rn-search-bar/tree/beta/exampletvOS

from react-native-screens.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.