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

Does the overflow prop from Image Style Props only work on iOS?

Open pafry7 opened this issue 7 months ago • 1 comments

Description

There is no documentation regarding overflow prop from Image Style Props.

What is the problem?

I've tried to use overflow prop to style the Image component, but it is difficult to find any documentation on its use case:

  1. The default value in the documentation is wrong. It says it is visible, but we can see that it's actually hidden.
  2. We can see that this prop works on iOS, but does nothing on Android. Snack Screenshot 2024-07-16 at 11 10 41

Clearly, it works differently than View's overflow, as Image component has no children. We can find some explanation in this commit. It states that: "overflow: 'hidden' is needed for network images with cover mode.". I tested this use case above, and it seems to have no effect on Android. I haven't delved too deeply into the code base, but I can guess that it may be related to:

  • different scaling/resizing method (either resizeMethod or Fresco internals),
  • lack of logic related to overflow in ReactImageView.java & friends (at least I couldn't find it).

How can we address it?

We could update the documentation with the explanation when and where this props work or someone with more knowledge on the subject could explain it.

Why is it important?

We should strive to have up-to-date documentation on platform compatibility.

pafry7 avatar Jul 19 '24 11:07 pafry7