I was working on responsive design in react native. I've used flagSize prop to modify the font size of the flag. I came across this design when making the font size responsive:
The width mentioned here is the cause of this UI issue. To solve this, I would override the width property with my own. Hence, I've introduced the containerStyle prop which will allow additional styles to be added to the View component encompassing the Flag UI.
For example, by using the implementation in my PR, I can create a component like this:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I was working on responsive design in react native. I've used
flagSize
prop to modify the font size of the flag. I came across this design when making the font size responsive:While debugging this design issue, I found out that a style is being applied to the container of the
Flag
component. The style is as follows: (https://github.com/xcarpentier/react-native-country-picker-modal/blob/master/src/Flag.tsx#L16)The
width
mentioned here is the cause of this UI issue. To solve this, I would override thewidth
property with my own. Hence, I've introduced thecontainerStyle
prop which will allow additional styles to be added to theView
component encompassing the Flag UI.For example, by using the implementation in my PR, I can create a component like this:
This will append my styles to the
View
container styles and solve the problem. Following is the UI after using this solution: