necolas / react-native-web

Cross-platform React UI packages
https://necolas.github.io/react-native-web
MIT License
21.46k stars 1.77k forks source link

onResponderEnd not called when tabbing while holding onto a view #2657

Open ToyboxZach opened 2 months ago

ToyboxZach commented 2 months ago

Is there an existing issue for this?

Describe the issue

If you have a Pressable and declare onResponderEnd


 <Pressable

        onResponderEnd={() => {
          console.log("VIEW END");
        }}
      >

Then start dragging on it and then press tab until you lose focus on it. You lose focus on it, but never have onResponderEnd get called

Expected behavior

onResponderEnd should be called whenever you lose touch focus on the view.

Steps to reproduce

Declare a pressable with onResponderEnd:

 <Pressable

        onResponderEnd={() => {
          console.log("VIEW END");
        }}
      >

Start holding it, and then tab away

Look at the console logs, for any things that come up.

In my demo, if the object stays blue we didn't get a release.

Test case

https://codesandbox.io/p/sandbox/react-native-web-pressable-nesting-forked-n2ffv2?file=%2Fsrc%2FApp.js%3A25%2C24

Additional comments

Issue arose while using this package @react-native-assets/slider

necolas commented 2 months ago

What does "tab away" mean?

ToyboxZach commented 2 months ago

Ah sorry that means press tab until you have focus on something else.