Skip to content

Commit 8e6e905

Browse files
committed
Update to HTML disabled attr instead of is-disabled CSS class
Update README to point to Bulma 0.9.1
1 parent 3b76a28 commit 8e6e905

File tree

4 files changed

+11
-17
lines changed

4 files changed

+11
-17
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ This changelog follows the patterns described here: https://keepachangelog.com/e
44

55
## Unreleased
66

7+
## 0.1.5
8+
### fixed
9+
- Fixed a few of the button & button-like components to use the HTML `disabled` attribute instead of the Bulma `is-disabled` CSS class. The latter has been deprecated for some time.
10+
- Update docs in the README to point to the latest Bulma 0.9.1 release.
11+
712
## 0.1.4
813
### added
914
- Add prop `padded` to Navbar. Setting this to true will wrap the contents of the navbar in a container to add padding to the contents under some circumstances.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "ybc"
3-
version = "0.1.4"
3+
version = "0.1.5"
44
description = "A Yew component library based on the Bulma CSS framework."
55
authors = ["Anthony Dodd <[email protected]>"]
66
edition = "2018"

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ ybc = "*"
6060

6161
### add bulma
6262
#### add bulma css (no customizations)
63-
This project works perfectly well if you just include the Bulma CSS in your HTML, [as described here](https://bulma.io/documentation/overview/start/). The following link in your HTML head should do the trick: `<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected].0/css/bulma.min.css"/>`.
63+
This project works perfectly well if you just include the Bulma CSS in your HTML, [as described here](https://bulma.io/documentation/overview/start/). The following link in your HTML head should do the trick: `<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected].1/css/bulma.min.css"/>`.
6464

6565
#### add bulma sass (allows customization & themes)
6666
However, if you want to customize Bulma to match your style guidelines, then you will need to have a copy of the Bulma SASS locally, and then import Bulma after you've defined your customizations, [as described here](https://bulma.io/documentation/customize/).

src/elements/button.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,8 @@ impl Component for Button {
124124
if self.props.r#static {
125125
classes.push("is-static")
126126
}
127-
if self.props.disabled {
128-
classes.push("is-disabled")
129-
}
130127
html! {
131-
<button class=classes onclick=self.props.onclick.clone()>
128+
<button class=classes onclick=self.props.onclick.clone() disabled=self.props.disabled>
132129
{self.props.children.clone()}
133130
</button>
134131
}
@@ -325,16 +322,14 @@ impl Component for ButtonAnchor {
325322
if self.props.r#static {
326323
classes.push("is-static")
327324
}
328-
if self.props.disabled {
329-
classes.push("is-disabled")
330-
}
331325
html! {
332326
<a
333327
class=classes
334328
onclick=self.props.onclick.clone()
335329
href=self.props.href.clone()
336330
rel=self.props.rel.clone().unwrap_or_default()
337331
target=self.props.target.clone().unwrap_or_default()
332+
disabled=self.props.disabled
338333
>
339334
{self.props.children.clone()}
340335
</a>
@@ -397,11 +392,8 @@ impl Component for ButtonInputSubmit {
397392
if self.props.r#static {
398393
classes.push("is-static")
399394
}
400-
if self.props.disabled {
401-
classes.push("is-disabled")
402-
}
403395
html! {
404-
<input type="submit" class=classes onsubmit=self.props.onsubmit.clone()/>
396+
<input type="submit" class=classes onsubmit=self.props.onsubmit.clone() disabled=self.props.disabled/>
405397
}
406398
}
407399
}
@@ -461,11 +453,8 @@ impl Component for ButtonInputReset {
461453
if self.props.r#static {
462454
classes.push("is-static")
463455
}
464-
if self.props.disabled {
465-
classes.push("is-disabled")
466-
}
467456
html! {
468-
<input type="reset" class=classes onreset=self.props.onreset.clone()/>
457+
<input type="reset" class=classes onreset=self.props.onreset.clone() disabled=self.props.disabled/>
469458
}
470459
}
471460
}

0 commit comments

Comments
 (0)