From 6ebd2e797d1a2f43fbe41e170c8529ec76cae877 Mon Sep 17 00:00:00 2001 From: melloware Date: Mon, 8 Aug 2022 08:11:14 -0400 Subject: [PATCH] Fix #3092: Dropdown support required attribute --- components/doc/dropdown/index.js | 24 ++++++++++++------------ components/lib/dropdown/Dropdown.js | 7 ++++--- pages/dropdown/index.js | 6 +++--- 3 files changed, 19 insertions(+), 18 deletions(-) diff --git a/components/doc/dropdown/index.js b/components/doc/dropdown/index.js index f091e12435..16d4d0fea7 100644 --- a/components/doc/dropdown/index.js +++ b/components/doc/dropdown/index.js @@ -187,17 +187,17 @@ export class DropdownDemo extends Component {
Basic
- +
Editable
- +
Grouped
Advanced with Templating, Filtering and Clear Icon
-
Virtual Scroll (100000 Items)
@@ -381,17 +381,17 @@ const DropdownDemo = () => {
Basic
- +
Editable
- +
Grouped
Advanced with Templating, Filtering and Clear Icon
-
Virtual Scroll (100000 Items)
@@ -574,17 +574,17 @@ const DropdownDemo = () => {
Basic
- +
Editable
- +
Grouped
Advanced with Templating, Filtering and Clear Icon
-
Virtual Scroll (100000 Items)
@@ -771,17 +771,17 @@ const DropdownDemo = () => {
Basic
- +
Editable
- +
Grouped
Advanced with Templating, Filtering and Clear Icon
-
Virtual Scroll (100000 Items)
diff --git a/components/lib/dropdown/Dropdown.js b/components/lib/dropdown/Dropdown.js index 1e3448926a..5c007868f7 100644 --- a/components/lib/dropdown/Dropdown.js +++ b/components/lib/dropdown/Dropdown.js @@ -600,11 +600,12 @@ export const Dropdown = React.memo(React.forwardRef((props, ref) => { const createHiddenSelect = () => { const placeHolderOption = ; - const option = selectedOption ? : null; + let selectedValue = selectedOption ? getOptionValue(selectedOption) : ""; + const option = selectedOption ? : null; return (
- selectedValue = e.target.value}> {placeHolderOption} {option} @@ -762,4 +763,4 @@ Dropdown.defaultProps = { onShow: null, onHide: null, onFilter: null -} \ No newline at end of file +} diff --git a/pages/dropdown/index.js b/pages/dropdown/index.js index 43b3aa5573..ed94ea2374 100644 --- a/pages/dropdown/index.js +++ b/pages/dropdown/index.js @@ -175,17 +175,17 @@ const DropdownDemo = () => {
Basic
- +
Editable
- +
Grouped
Advanced with Templating, Filtering and Clear Icon
-
Virtual Scroll (100000 Items)