diff --git a/CHANGELOG.md b/CHANGELOG.md index f745d00..e767115 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +## 2.5.1 + +- `bones_ui_web`: + - `setValue`: Update handling of `CheckboxInputElement`. + ## 2.5.0 - sdk: '>=3.3.0 <4.0.0' diff --git a/lib/src/bones_ui.dart b/lib/src/bones_ui.dart index c297d2a..9729344 100644 --- a/lib/src/bones_ui.dart +++ b/lib/src/bones_ui.dart @@ -1,3 +1,3 @@ class BonesUI { - static const String version = '2.5.0'; + static const String version = '2.5.1'; } diff --git a/lib/src/bones_ui_web.dart b/lib/src/bones_ui_web.dart index 9f77607..b990310 100644 --- a/lib/src/bones_ui_web.dart +++ b/lib/src/bones_ui_web.dart @@ -1,5 +1,6 @@ import 'dart:html' as web; import 'package:dom_tools/dom_tools.dart'; +import 'package:swiss_knife/swiss_knife.dart'; typedef UIElement = web.Element; typedef UINode = web.Node; @@ -40,7 +41,10 @@ extension UIElementExtension on UIElement { void setValue(String? value) { final element = this; - if (element is web.InputElement) { + if (element is web.CheckboxInputElement) { + var checked = parseBool(value) ?? false; + element.checked = checked; + } else if (element is web.InputElement) { element.value = value; } else { element.text = value; diff --git a/pubspec.yaml b/pubspec.yaml index 44f6920..fe17412 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: bones_ui description: Bones_UI - An intuitive and user-friendly Web User Interface framework for Dart. -version: 2.5.0 +version: 2.5.1 homepage: https://github.com/Colossus-Services/bones_ui environment: