@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.
@@ -1 +1 @@
1
- {"version":3,"file":"MoneyInput.d.ts","sourceRoot":"","sources":["../../../src/moneyInput/MoneyInput.js"],"names":[],"mappings":";;;;AA+DA;IACE,wBAeC;IAZC,mBAAkD;IAClD;;;;;MAUC;IAGH,uDAaC;IAED,+CAWE;IAEF,oCAIE;IAEF,kCAyBE;IAEF,qCAgBE;IAEF,yBAGE;IAFA,mCAA0B;IAI5B,0BAEE;IAEF;;;;MAME;IAEF,0BAuBC;IAED,kBAsBC;IAED,yCAIE;IAEF,+BAKE;IAEF,+CAQE;IAEF,+BAAqE;IAErE,sCAiIC;CACF"}
1
+ {"version":3,"file":"MoneyInput.d.ts","sourceRoot":"","sources":["../../../src/moneyInput/MoneyInput.js"],"names":[],"mappings":";;;;AA+DA;IACE,wBAeC;IAZC,mBAAkD;IAClD;;;;;MAUC;IAGH,uDAaC;IAED,+CAWE;IAEF,oCAIE;IAEF,kCAyBE;IAEF,qCAgBE;IAEF,yBAGE;IAFA,mCAA0B;IAI5B,0BAEE;IAEF;;;;MAME;IAEF,0BAuBC;IAED,kBAsBC;IAED,yCAIE;IAEF,+BAKE;IAEF,+CAQE;IAEF,+BAAqE;IAErE,sCAmIC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@transferwise/components",
3
- "version": "0.0.0-experimental-ac57725",
3
+ "version": "0.0.0-experimental-82772cf",
4
4
  "description": "Neptune React components",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -254,24 +254,25 @@ class MoneyInput extends Component {
254
254
  this.props;
255
255
  const selectOptions = this.getSelectOptions();
256
256
 
257
- const firstOptionValue = () => {
257
+ const getFirstOption = () => {
258
258
  if (selectOptions.length !== 0) {
259
259
  const firstOption = selectOptions[0];
260
260
  if (firstOption.type === 'option') {
261
- return firstOption.value.value;
261
+ return firstOption.value;
262
262
  }
263
263
  if (firstOption.type === 'group' && firstOption.options.length !== 0) {
264
- return firstOption.options[0].value.value;
264
+ return firstOption.options[0].value;
265
265
  }
266
266
  }
267
267
  return null;
268
268
  };
269
269
 
270
- const firstOption = firstOptionValue();
270
+ const firstOption = getFirstOption();
271
271
 
272
272
  const isFixedCurrency =
273
- (selectOptions.length === 1 && firstOption === selectedCurrency.currency) ||
274
- !onCurrencyChange;
273
+ !this.state.searchQuery &&
274
+ ((selectOptions.length === 1 && firstOption.currency === selectedCurrency.currency) ||
275
+ !onCurrencyChange);
275
276
 
276
277
  const disabled = !this.props.onAmountChange;
277
278
  return (
@@ -346,6 +347,7 @@ class MoneyInput extends Component {
346
347
  <SelectInput
347
348
  items={selectOptions}
348
349
  value={this.state.selectedOption}
350
+ compareValues="currency"
349
351
  renderValue={(currency, withinTrigger) => {
350
352
  return (
351
353
  <SelectInputOptionContent