Skip to content

Commit

Permalink
text justification falsy bug
Browse files Browse the repository at this point in the history
  • Loading branch information
RobMayer committed Dec 30, 2023
1 parent e504536 commit 1b4eacc
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": "2.2.1",
"version": "2.2.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 @@ -552,7 +552,7 @@ const textElement = (attrs: JSX.IntrinsicElements["text"], children?: string[])
element.setText(children?.join(""));
}
element.setAutoWrap(!!attrs.wrap);
if (attrs.justify) {
if (attrs.justify !== undefined) {
element.setJustification(attrs.justify);
}
return element;
Expand All @@ -564,7 +564,7 @@ const buttonElement = (attrs: JSX.IntrinsicElements["button"], children?: string
if (attrs.onClick) {
element.onClicked.add(attrs.onClick);
}
if (attrs.justify) {
if (attrs.justify !== undefined) {
element.setJustification(attrs.justify);
}
if (children) {
Expand Down Expand Up @@ -647,7 +647,7 @@ const richtextElement = (attrs: JSX.IntrinsicElements["richtext"], children?: st
element.setText(children?.join("\n"));
}
element.setAutoWrap(!!attrs.wrap);
if (attrs.justify) {
if (attrs.justify !== undefined) {
element.setJustification(attrs.justify);
}
return element;
Expand Down

0 comments on commit 1b4eacc

Please sign in to comment.