Skip to content

Web Compatibility: pointerEvents: 'box-none' and AccessibilityInfo.isScreenReaderEnabled Issues #68

@sudhanshug16

Description

@sudhanshug16

Hey, thanks for the library first of all!

Running into a couple of issues on web:

  1. AccessibilityInfo.isScreenReaderEnabled always returns true on web.

    • This means toasts don't show up by default.
    • I found two fixes:
      • Set preventScreenReaderFromHiding to true.
      • Or, for web: Object.assign(AccessibilityInfo, {isScreenReaderEnabled: () => Promise.resolve(false)}).
    • Since screen reader detection is unreliable on web, a better default or web-specific handling for visibility would be great.
  2. pointerEvents: 'box-none' doesn't work the same on web.

    • On native, it lets touches pass through while children are touchable. On web, this doesn't happen.
    • I got the toast to mostly work by wrapping it with a View that had pointerEvents: 'none'.
    • But, that messes up the dismiss button on the Toast itself (since nothing inside the wrapper is touchable now).

Would love to figure out a solution for these web compatibility problems. The main goals would be for toasts to be visible by default on web and for interactive elements within the toast (like dismiss buttons) to work correctly.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions