diff --git a/src/CONST.js b/src/CONST.js index f055faaa97e6..95b9d23abca5 100755 --- a/src/CONST.js +++ b/src/CONST.js @@ -329,6 +329,16 @@ const CONST = { NATIVE: 'Native', }, + BROWSER: { + CHROME: 'chrome', + FIREFOX: 'firefox', + IE: 'ie', + EDGE: 'edge', + Opera: 'opera', + SAFARI: 'safari', + OTHER: 'other', + }, + IOU: { // Note: These payment types are used when building IOU reportAction message values in the server and should // not be changed. diff --git a/src/components/Picker/index.js b/src/components/Picker/index.js index 28ff3ff877ea..028f8d23563b 100644 --- a/src/components/Picker/index.js +++ b/src/components/Picker/index.js @@ -28,6 +28,10 @@ const Picker = ({ fixAndroidTouchableBug onOpen={onOpen} onClose={onClose} + pickerProps={{ + onFocus: onOpen, + onBlur: onClose, + }} /> ); diff --git a/src/components/Picker/pickerStyles/index.js b/src/components/Picker/pickerStyles/index.js index 7c11a9f8ed86..beee55bd1fc9 100644 --- a/src/components/Picker/pickerStyles/index.js +++ b/src/components/Picker/pickerStyles/index.js @@ -1,5 +1,22 @@ +import CONST from '../../../CONST'; +import getBrowser from '../../../libs/getBrowser'; import styles from '../../../styles/styles'; -const pickerStyles = disabled => styles.expensiPicker(disabled); +const pickerStylesWeb = () => { + if (CONST.BROWSER.FIREFOX === getBrowser()) { + return { + textIndent: -2, + }; + } + return {}; +}; + +const pickerStyles = disabled => ({ + ...styles.expensiPicker(disabled), + inputWeb: { + ...styles.expensiPicker(disabled).inputWeb, + ...pickerStylesWeb(), + }, +}); export default pickerStyles; diff --git a/src/libs/actions/App.js b/src/libs/actions/App.js index e6a4ffb7cd5c..03511072c32c 100644 --- a/src/libs/actions/App.js +++ b/src/libs/actions/App.js @@ -36,7 +36,9 @@ function setCurrentURL(url) { * @param {String} locale */ function setLocale(locale) { - API.PreferredLocale_Update({name: 'preferredLocale', value: locale}); + if (currentUserAccountID) { + API.PreferredLocale_Update({name: 'preferredLocale', value: locale}); + } Onyx.merge(ONYXKEYS.NVP_PREFERRED_LOCALE, locale); } diff --git a/src/libs/getBrowser/index.js b/src/libs/getBrowser/index.js new file mode 100644 index 000000000000..94bc2b70e392 --- /dev/null +++ b/src/libs/getBrowser/index.js @@ -0,0 +1 @@ +export default () => ''; diff --git a/src/libs/getBrowser/index.web.js b/src/libs/getBrowser/index.web.js new file mode 100644 index 000000000000..8adc6591d02a --- /dev/null +++ b/src/libs/getBrowser/index.web.js @@ -0,0 +1,42 @@ +import CONST from '../../CONST'; + +/** + * Fetch browser name from UA string + * + * @return {String} e.g. Chrome + */ +function getBrowser() { + const {userAgent} = window.navigator; + let match = userAgent.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))/i) || []; + let temp; + + if (/trident/i.test(match[1])) { + return 'IE'; + } + + if (match[1] && (match[1].toLowerCase() === 'chrome')) { + temp = userAgent.match(/\b(OPR|Edge)\/(\d+)/); + + if (temp !== null) { + return temp.slice(1).replace('OPR', 'Opera'); + } + + temp = userAgent.match(/\b(Edg)\/(\d+)/); + + if (temp !== null) { + return temp.slice(1).replace('Edg', 'Edge'); + } + } + + match = match[1] ? match[1] : navigator.appName; + return match; +} + +/** + * Get the Browser name + * @returns {String} + */ +export default () => { + const browser = getBrowser(); + return browser ? browser.toLowerCase() : CONST.BROWSER.OTHER; +}; diff --git a/src/styles/styles.js b/src/styles/styles.js index 2b08dfa7bc6d..66c5858464ee 100644 --- a/src/styles/styles.js +++ b/src/styles/styles.js @@ -370,6 +370,7 @@ const styles = { borderRadius: variables.componentBorderRadius, borderWidth: 1, borderColor: themeColors.border, + borderStyle: 'solid', color: themeColors.text, height: variables.componentSizeSmall, opacity: 1, @@ -385,6 +386,7 @@ const styles = { borderWidth: 1, borderRadius: variables.componentBorderRadius, borderColor: themeColors.border, + borderStyle: 'solid', color: themeColors.text, appearance: 'none', height: variables.componentSizeSmall, @@ -402,6 +404,7 @@ const styles = { borderWidth: 1, borderRadius: variables.componentBorderRadius, borderColor: themeColors.border, + borderStyle: 'solid', color: themeColors.text, height: variables.componentSizeSmall, opacity: 1,