@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.esm.js
CHANGED
|
@@ -12292,7 +12292,12 @@ class Typeahead extends Component {
|
|
|
12292
12292
|
query = item.label;
|
|
12293
12293
|
}
|
|
12294
12294
|
this.updateSelectedValue(selected);
|
|
12295
|
-
|
|
12295
|
+
if (!item.keepFocusOnSelect) {
|
|
12296
|
+
this.hideMenu();
|
|
12297
|
+
}
|
|
12298
|
+
if (item.clearQueryOnSelect) {
|
|
12299
|
+
query = '';
|
|
12300
|
+
}
|
|
12296
12301
|
this.setState({
|
|
12297
12302
|
query
|
|
12298
12303
|
});
|
|
@@ -12416,14 +12421,14 @@ class Typeahead extends Component {
|
|
|
12416
12421
|
className: "dropdown-menu",
|
|
12417
12422
|
role: "menu",
|
|
12418
12423
|
"aria-labelledby": "dropdownMenu1",
|
|
12419
|
-
children: [optionsToRender.map((option, idx) => /*#__PURE__*/jsx(Option, {
|
|
12424
|
+
children: [optionsToRender.length > 0 ? optionsToRender.map((option, idx) => /*#__PURE__*/jsx(Option, {
|
|
12420
12425
|
query: query,
|
|
12421
12426
|
option: option,
|
|
12422
12427
|
selected: keyboardFocusedOptionIndex === idx,
|
|
12423
12428
|
onClick: event => {
|
|
12424
12429
|
this.onOptionSelected(event, option);
|
|
12425
12430
|
}
|
|
12426
|
-
}, `${option.label}${idx.toString()}`)), footer]
|
|
12431
|
+
}, `${option.label}${idx.toString()}`)) : null, footer]
|
|
12427
12432
|
})
|
|
12428
12433
|
});
|
|
12429
12434
|
};
|
|
@@ -12519,10 +12524,10 @@ class Typeahead extends Component {
|
|
|
12519
12524
|
children: /*#__PURE__*/jsx(Cross, {})
|
|
12520
12525
|
})
|
|
12521
12526
|
})]
|
|
12522
|
-
}), displayAlert
|
|
12527
|
+
}), displayAlert ? /*#__PURE__*/jsx(InlineAlert, {
|
|
12523
12528
|
type: alert.type,
|
|
12524
12529
|
children: alert.message
|
|
12525
|
-
})
|
|
12530
|
+
}) : menu]
|
|
12526
12531
|
})
|
|
12527
12532
|
});
|
|
12528
12533
|
}
|