@transferwise/components 0.0.0-experimental-ac57725 → 0.0.0-experimental-82772cf
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/index.js
CHANGED
|
@@ -8063,20 +8063,20 @@ class MoneyInput extends React.Component {
|
|
|
8063
8063
|
maxLengthOverride
|
|
8064
8064
|
} = this.props;
|
|
8065
8065
|
const selectOptions = this.getSelectOptions();
|
|
8066
|
-
const
|
|
8066
|
+
const getFirstOption = () => {
|
|
8067
8067
|
if (selectOptions.length !== 0) {
|
|
8068
8068
|
const firstOption = selectOptions[0];
|
|
8069
8069
|
if (firstOption.type === 'option') {
|
|
8070
|
-
return firstOption.value
|
|
8070
|
+
return firstOption.value;
|
|
8071
8071
|
}
|
|
8072
8072
|
if (firstOption.type === 'group' && firstOption.options.length !== 0) {
|
|
8073
|
-
return firstOption.options[0].value
|
|
8073
|
+
return firstOption.options[0].value;
|
|
8074
8074
|
}
|
|
8075
8075
|
}
|
|
8076
8076
|
return null;
|
|
8077
8077
|
};
|
|
8078
|
-
const firstOption =
|
|
8079
|
-
const isFixedCurrency = selectOptions.length === 1 && firstOption === selectedCurrency.currency || !onCurrencyChange;
|
|
8078
|
+
const firstOption = getFirstOption();
|
|
8079
|
+
const isFixedCurrency = !this.state.searchQuery && (selectOptions.length === 1 && firstOption.currency === selectedCurrency.currency || !onCurrencyChange);
|
|
8080
8080
|
const disabled = !this.props.onAmountChange;
|
|
8081
8081
|
return /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
8082
8082
|
className: classNames__default.default(this.style('tw-money-input'), this.style('input-group'), this.style(`input-group-${size}`)),
|
|
@@ -8115,6 +8115,7 @@ class MoneyInput extends React.Component {
|
|
|
8115
8115
|
children: /*#__PURE__*/jsxRuntime.jsx(SelectInput, {
|
|
8116
8116
|
items: selectOptions,
|
|
8117
8117
|
value: this.state.selectedOption,
|
|
8118
|
+
compareValues: "currency",
|
|
8118
8119
|
renderValue: (currency, withinTrigger) => {
|
|
8119
8120
|
return /*#__PURE__*/jsxRuntime.jsx(SelectInputOptionContent, {
|
|
8120
8121
|
title: currency.label,
|