Skip to content

Keyboard.addListener ignores its context argument #58230

Description

@OskarEichler

Description

The public Keyboard.addListener(eventType, listener, context?) signature accepts a listener context, but the implementation forwards only the event type and callback to NativeEventEmitter. The supplied context is therefore silently discarded.

Expected behavior

When a context is supplied, keyboard event callbacks should run with that object as this, matching the underlying NativeEventEmitter contract.

React Native Version

0.87.1 and current main

Affected Platforms

JavaScript runtime - All

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions