Add class prop to HtmlSelect (#90)

This commit is contained in:
Cecile Tonglet 2021-03-08 10:17:36 +01:00 committed by GitHub
parent 904715797a
commit bcc89cfef5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,6 +27,8 @@ pub struct HtmlSelectProps<T: Clone + PartialEq + 'static> {
pub options: Vec<(T, String)>,
#[prop_or_default]
pub value: Option<T>,
#[prop_or_default]
pub class: Classes,
}
impl<T: Clone + PartialEq + Hash + 'static> Component for HtmlSelect<T> {
@ -94,6 +96,7 @@ impl<T: Clone + PartialEq + Hash + 'static> Component for HtmlSelect<T> {
self.props.large.then(|| "bp3-large"),
self.props.fill.then(|| "bp3-fill"),
self.props.disabled.then(|| "bp3-disabled"),
self.props.class.clone(),
)
>
<select