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

Mark Keyboard module as unsupported on VisionOS #6

Closed
okwasniewski opened this issue Oct 20, 2023 · 8 comments · Fixed by #25 or #71
Closed

Mark Keyboard module as unsupported on VisionOS #6

okwasniewski opened this issue Oct 20, 2023 · 8 comments · Fixed by #25 or #71
Assignees
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@okwasniewski
Copy link
Member

okwasniewski commented Oct 20, 2023

Description

Goal of this issue is to mark Keyboard module as unsupported for VisionOS.

As stated in Apple docs: https://developer.apple.com/documentation/uikit/uikeyboardwillshownotification?language=objc :

An app running in visionOS never receives this notification. The system displays the keyboard in a separate window, leaving the app’s window unaffected by the keyboard’s appearance and disappearance.

Goals:

  • Avoid registering listeners inside RCTKeyboardObserver (#if TARGET_OS_VISION)
  • Mark Keyboard and KeyboardAvoidingView as not supported
@okwasniewski okwasniewski changed the title MarkKeyboard module as unsupported on VisionOS Mark Keyboard module as unsupported on VisionOS Oct 20, 2023
@okwasniewski okwasniewski added good first issue Good for newcomers bug Something isn't working labels Oct 20, 2023
@thiagobrez
Copy link

I can take this one!

@thiagobrez
Copy link

@okwasniewski PR #25 is open for review, but I'm getting a memory leak. Probably related to the changes in RCTKeyboardObserver but did not find the culprit yet.

WARN  Sending `didReceiveNetworkData` with no listeners registered.
WARN  Sending `didCompleteNetworkResponse` with no listeners registered.
WARN  Sending `didSendNetworkData` with no listeners registered.
WARN  Sending `didSendNetworkData` with no listeners registered.
WARN  Sending `didSendNetworkData` with no listeners registered.
WARN  Sending `didReceiveNetworkResponse` with no listeners registered.

Will continue investigating, but sending here in case you see something I don't!

@TMisiukiewicz
Copy link

@thiagobrez I had the same issue, it was a bug in the core and it was already reverted:
facebook@8ac47fa
facebook@4e04ff5

@thiagobrez
Copy link

Yeah thanks @TMisiukiewicz! @okwasniewski also warned me about it, good to know 🙏🏻

So I'll just wait for it to be synced and re-test

@derwaldgeist
Copy link

derwaldgeist commented Jan 11, 2024

I actually was confused by the message:

"Keyboard is not available on visionOS platform."

I read this as if React Native visionOS would not support text input at all? Or do you mean that just a certain way to hook into keyboard notifications is unsupported, i.e. to get notified when the keyboard pops up?

@okwasniewski
Copy link
Member Author

I think refining this message as Keyboard API is not available on visionOS platform. would be better. visionOS supports text inputs but doesn't support receiving events and imperatively controlling the keyboard.

I will re-open this issue to take care of this. I also noticed that this pops up when user is not using Keyboard API

@okwasniewski okwasniewski reopened this Jan 11, 2024
@derwaldgeist
Copy link

Yes, makes sense. Does this also mean that keyboard events won't work in general? Like to check if the enter key has been pressed in an input field?

@okwasniewski
Copy link
Member Author

okwasniewski commented Jan 15, 2024

@derwaldgeist Keyboard API doesn't handle this. You can use TextInput's onSubmitEditing callback to detect when user pressed the enter (submit key) and it works properly on visionOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
4 participants