react-native icon indicating copy to clipboard operation
react-native copied to clipboard

OnDeviceUI causes stories to inherit SafeAreaView and KeyboardAvoidingView

Open lidio601 opened this issue 5 years ago • 1 comments

When testing simple UI components it's all good.

The problem comes when you're testing a full-screen story like this one:

as you can see by specifying {onDeviceUI: true} the vertical space is reduced because of the SafeAreaView inherited by the OnDeviceUI component.

Furthermore, our Screen component is already considering the SafeAreaView insets and providing its own KeyboardAvoidingView instance so this double KeyboardAvoidingView could create also functionality issues.

If I specify {onDeviceUI: false} the problem is solved:

Having the OnDeviceUI helps non-developers to review components even testing on an actual app release.

I think the solution would be to have the OnDeviceUI to be an actual overlay on top of the StoryView instead of wrapping all the stories

What do you think?

lidio601 avatar Jul 08 '20 05:07 lidio601

I think the solution would be to have the OnDeviceUI to be an actual overlay on top of the StoryView

I like this idea but I'm not sure how that would effect the UI, would need some testing. I'll try to experiment with this at some point.

In the meantime if you think you can make it work then please feel free to open a PR it would be apreciated :)

dannyhw avatar Aug 04 '20 15:08 dannyhw

Safe area can now be toggled by parameter

dannyhw avatar Mar 04 '23 13:03 dannyhw