Skip to content

Commit

Permalink
v2.1.9
Browse files Browse the repository at this point in the history
- Fix `onKeyDown` handling and building.
  • Loading branch information
gmpassos committed Jun 1, 2023
1 parent 727a71e commit 7b51298
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.1.9

- Fix `onKeyDown` handling and building.

## 2.1.8

- Optimize:
Expand Down
3 changes: 3 additions & 0 deletions lib/src/dom_builder_base.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1816,6 +1816,9 @@ class DOMElement extends DOMNode implements AsDOMElement {
} else if (attrName == 'onkeyup') {
onKeyUp.listen((_) => dsx.call());
return true;
} else if (attrName == 'onkeydown') {
onKeyDown.listen((_) => dsx.call());
return true;
} else if (attrName == 'onerror') {
onError.listen((_) => dsx.call());
return true;
Expand Down
7 changes: 7 additions & 0 deletions lib/src/dom_builder_generator_dart_html.dart
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,13 @@ class DOMGeneratorDartHTMLImpl extends DOMGeneratorDartHTML<Node> {
});
}

if (domElement.hasOnKeyDownListener) {
element.onKeyDown.listen((event) {
var domEvent = createDOMEvent(treeMap, event)!;
domElement.onKeyDown.add(domEvent);
});
}

if (domElement.hasOnMouseOverListener) {
element.onMouseOver.listen((event) {
var domEvent = createDOMMouseEvent(treeMap, event)!;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: dom_builder
description: Generate and manipulate DOM elements (virtual or real), DSX (like JSX) and HTML declarations (Web and Native support).
version: 2.1.8
version: 2.1.9
homepage: https://github.com/gmpassos/dom_builder

environment:
Expand Down

0 comments on commit 7b51298

Please sign in to comment.