@transferwise/components 0.0.0-experimental-892d236 → 0.0.0-experimental-20865d1
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.esm.js +10 -5
- package/build/index.esm.js.map +1 -1
- package/build/index.js +10 -5
- package/build/index.js.map +1 -1
- package/build/types/typeahead/Typeahead.d.ts +2 -0
- package/build/types/typeahead/Typeahead.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/typeahead/Typeahead.tsx +25 -14
package/build/index.js
CHANGED
|
@@ -12326,7 +12326,12 @@ class Typeahead extends React.Component {
|
|
|
12326
12326
|
query = item.label;
|
|
12327
12327
|
}
|
|
12328
12328
|
this.updateSelectedValue(selected);
|
|
12329
|
-
|
|
12329
|
+
if (!item.keepFocusOnSelect) {
|
|
12330
|
+
this.hideMenu();
|
|
12331
|
+
}
|
|
12332
|
+
if (item.clearQueryOnSelect) {
|
|
12333
|
+
query = '';
|
|
12334
|
+
}
|
|
12330
12335
|
this.setState({
|
|
12331
12336
|
query
|
|
12332
12337
|
});
|
|
@@ -12450,14 +12455,14 @@ class Typeahead extends React.Component {
|
|
|
12450
12455
|
className: "dropdown-menu",
|
|
12451
12456
|
role: "menu",
|
|
12452
12457
|
"aria-labelledby": "dropdownMenu1",
|
|
12453
|
-
children: [optionsToRender.map((option, idx) => /*#__PURE__*/jsxRuntime.jsx(Option, {
|
|
12458
|
+
children: [optionsToRender.length > 0 ? optionsToRender.map((option, idx) => /*#__PURE__*/jsxRuntime.jsx(Option, {
|
|
12454
12459
|
query: query,
|
|
12455
12460
|
option: option,
|
|
12456
12461
|
selected: keyboardFocusedOptionIndex === idx,
|
|
12457
12462
|
onClick: event => {
|
|
12458
12463
|
this.onOptionSelected(event, option);
|
|
12459
12464
|
}
|
|
12460
|
-
}, `${option.label}${idx.toString()}`)), footer]
|
|
12465
|
+
}, `${option.label}${idx.toString()}`)) : null, footer]
|
|
12461
12466
|
})
|
|
12462
12467
|
});
|
|
12463
12468
|
};
|
|
@@ -12553,10 +12558,10 @@ class Typeahead extends React.Component {
|
|
|
12553
12558
|
children: /*#__PURE__*/jsxRuntime.jsx(icons.Cross, {})
|
|
12554
12559
|
})
|
|
12555
12560
|
})]
|
|
12556
|
-
}), displayAlert
|
|
12561
|
+
}), displayAlert ? /*#__PURE__*/jsxRuntime.jsx(InlineAlert, {
|
|
12557
12562
|
type: alert.type,
|
|
12558
12563
|
children: alert.message
|
|
12559
|
-
})
|
|
12564
|
+
}) : menu]
|
|
12560
12565
|
})
|
|
12561
12566
|
});
|
|
12562
12567
|
}
|