Open debdalc opened 3 months ago
Trying to zero in on where the failure might be happening here. Could be in the pressable/touchable disabled, could be in the flyout, could be in the ref.
Is the issue that the Flyout shows but doesn't have the target
ref (due to some bug with that going enabled->disabled->enabled) and thus doesn't show? As in does this work if target is unset and your Flyout shows floating without that alignment?
Not saying that's what you should do, just trying to narrow down the issue. There's a lot that's happened between 0.66 and 0.74 ;) (including specifically changes to enabled/disabled handling)
I'm seeing this issue in 73!
In 72 the pressable button works fine but the touchable opacity does not.
Is the issue that the Flyout shows but doesn't have the
target
ref (due to some bug with that going enabled->disabled->enabled) and thus doesn't show? As in does this work if target is unset and your Flyout shows floating without that alignment?
@chrisglein Yes, removing the target prop from the flyout does make it display at a random location on the screen, in our actual project it was appearing at the top left corner. In the demo app as can be seen from the video below it appears at the bottom left corner.
Problem Description
I'm working on a react-native-windows project which was just recently updated to 0.74 from 0.66. After updating we had some issues arise with our custom dropdown component. In this component, a Touchable Opacity acts as the dropdown button and a Flyout is rendered to display the list of options in the dropdown underneath the button, using the Touchable Opacity reference for the target prop.
We disable the dropdown by disabling the touchable opacity. When the component is enabled again, the flyout stops rendering in unless it is forced to re-draw. This behaviour was not present before updating to 0.74.
I've provided a reproducible example which also shows that this issue is also seen with Pressable. It seems any target reference that is disabled atleast once, will prevent the Flyout from displaying with that target. A video demo of this example can be viewed below:
https://github.com/microsoft/react-native-windows/assets/142518306/7469c5fc-3327-459d-a078-b4e1b5a4e282
Steps To Reproduce
isDisabled
which is passed into the disabled prop of both the buttons.Current Workaround for us
We found that passing the reference object of the View component within Touchable Opacity or Pressable to the target prop in Flyout gets around the issue for now, so this issue isn't blocker for our project
CLI version
13.6.6
Environment
Target Device(s)
Desktop
Visual Studio Version
Visual Studio 2022
Build Configuration
Debug
Snack, code example, screenshot, or link to a repository
Code Snippet from Demo App