Fix new dropdown selected_index not work (#60)

This commit is contained in:
Floyd Wang 2024-07-23 19:18:39 +08:00 committed by GitHub
parent db14f0a2e5
commit 1b715c431f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -215,7 +215,7 @@ where
cleanable: true, cleanable: true,
title_prefix: None, title_prefix: None,
}; };
this.update_selected_value(cx); this.set_selected_index(selected_index, cx);
this this
} }
@ -426,7 +426,9 @@ where
.input_px(self.size) .input_px(self.size)
.input_py(self.size) .input_py(self.size)
.input_h(self.size) .input_h(self.size)
.on_click(cx.listener(Self::toggle_menu)) .when(!self.open, |this| {
this.on_click(cx.listener(Self::toggle_menu))
})
.child( .child(
h_flex() h_flex()
.w_full() .w_full()