Skip to content

Commit

Permalink
switcher bug
Browse files Browse the repository at this point in the history
  • Loading branch information
RobMayer committed Sep 4, 2023
1 parent e120265 commit 849401b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "jsx-in-ttpg",
"license": "UNLICENSE",
"version": "1.3.1",
"version": "1.3.2",
"scripts": {
"build": "tsup src/index.ts --format cjs,esm --dts --no-splitting",
"clean": "rm -rf ./dist",
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -775,16 +775,16 @@ const browserElement = (attrs: JSX.IntrinsicElements["browser"]) => {
const switchElement = (attrs: JSX.IntrinsicElements["switch"], children?: Widget[]) => {
const element = new WidgetSwitcher();
doCommon(element, attrs);
if (children) {
children.forEach(element.addChild);
}
if (attrs.value) {
if (attrs.value instanceof Widget) {
element.setActiveWidget(attrs.value);
} else {
element.setActiveIndex(attrs.value);
}
}
if (children) {
children.forEach(element.addChild);
}
return element;
};

Expand Down

0 comments on commit 849401b

Please sign in to comment.