From bb3046ea13a8942719048465ed2206a99c9c2212 Mon Sep 17 00:00:00 2001 From: OlimpiaZurek Date: Wed, 12 Apr 2023 09:42:51 +0200 Subject: [PATCH] preserve white spaces on Web --- src/index.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 07e24fc9..b7ce7b12 100644 --- a/src/index.js +++ b/src/index.js @@ -10,6 +10,10 @@ import { Dimensions } from 'react-native'; // This height was tested thoroughly on several iPhone Models (from iPhone 8 to 14 Pro) const IOS_MODAL_HEIGHT = 262; +const preserveSpaces = (label) => { + return label.replace(/ /g, '\u00a0'); + } + export default class RNPickerSelect extends PureComponent { static propTypes = { onValueChange: PropTypes.func.isRequired, @@ -298,7 +302,7 @@ export default class RNPickerSelect extends PureComponent { return items.map((item) => { return (