Skip to content

Commit c2baf11

Browse files
committed
Fix a bug that the disabled attribute function recursively calls itself
1 parent 5eec3fe commit c2baf11

File tree

1 file changed

+2
-3
lines changed
  • compose-html-common/src/jsMain/kotlin/com/huanshankeji/compose/web/attributes/ext

1 file changed

+2
-3
lines changed

compose-html-common/src/jsMain/kotlin/com/huanshankeji/compose/web/attributes/ext/Attrs.kt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ fun AttrsScope<*>.ariaLabel(value: String) =
2929

3030
// https://www.w3schools.com/tags/att_disabled.asp
3131
// https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/disabled
32-
fun AttrsScope<*>.disabled(disabled: Boolean?) {
33-
disabled?.let { disabled(it) }
34-
}
32+
fun AttrsScope<*>.disabled(value: Boolean?) =
33+
attrIfNotNull("disabled", value)
3534

3635
// https://www.w3schools.com/tags/att_href.asp
3736
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#href

0 commit comments

Comments
 (0)