Skip to content

Commit d4130a5

Browse files
committed
update
1 parent 4b95b1f commit d4130a5

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

ui/src/pages/Generator/QRcode/components/Output.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ const Output: FC<OutputProps> = ({
3434
downloadQRCode,
3535
}) => {
3636
const domEl = useRef<Array<HTMLDivElement>>([]);
37+
const trimmedValue = value.trim();
3738

3839
return (
3940
<Card className={classNames(styles.qrcode__output, "qrcode")}>
@@ -43,7 +44,7 @@ const Output: FC<OutputProps> = ({
4344
}
4445
multiple={multiLine}
4546
/>
46-
{value.length > 0 ? (
47+
{trimmedValue.length > 0 ? (
4748
<Space
4849
direction="vertical"
4950
align="center"
@@ -52,7 +53,7 @@ const Output: FC<OutputProps> = ({
5253
>
5354
<QRCodeErrorBoundary>
5455
{multiLine ? (
55-
value.split("\n").map((line, index) => (
56+
trimmedValue.split("\n").map((line, index) => (
5657
<>
5758
<div
5859
ref={(ref) => {
@@ -68,7 +69,7 @@ const Output: FC<OutputProps> = ({
6869
key={index}
6970
>
7071
<QRCode
71-
value={line}
72+
value={line.trim()}
7273
color={color}
7374
bgColor={bgColor}
7475
bordered={bordered}
@@ -82,7 +83,7 @@ const Output: FC<OutputProps> = ({
8283
))
8384
) : (
8485
<QRCode
85-
value={value}
86+
value={trimmedValue}
8687
color={color}
8788
bgColor={bgColor}
8889
bordered={bordered}

ui/src/pages/Generator/QRcode/components/UserInputs.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const UserInputs: FC<UserInputsProps> = ({
101101
<TextArea
102102
value={value}
103103
rows={7}
104-
onChange={(e) => setValue(e.target.value.trim())}
104+
onChange={(e) => setValue(e.target.value)}
105105
data-gramm={false}
106106
placeholder="Enter input"
107107
allowClear

0 commit comments

Comments
 (0)