File tree 2 files changed +6
-5
lines changed
ui/src/pages/Generator/QRcode/components 2 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ const Output: FC<OutputProps> = ({
34
34
downloadQRCode,
35
35
} ) => {
36
36
const domEl = useRef < Array < HTMLDivElement > > ( [ ] ) ;
37
+ const trimmedValue = value . trim ( ) ;
37
38
38
39
return (
39
40
< Card className = { classNames ( styles . qrcode__output , "qrcode" ) } >
@@ -43,7 +44,7 @@ const Output: FC<OutputProps> = ({
43
44
}
44
45
multiple = { multiLine }
45
46
/>
46
- { value . length > 0 ? (
47
+ { trimmedValue . length > 0 ? (
47
48
< Space
48
49
direction = "vertical"
49
50
align = "center"
@@ -52,7 +53,7 @@ const Output: FC<OutputProps> = ({
52
53
>
53
54
< QRCodeErrorBoundary >
54
55
{ multiLine ? (
55
- value . split ( "\n" ) . map ( ( line , index ) => (
56
+ trimmedValue . split ( "\n" ) . map ( ( line , index ) => (
56
57
< >
57
58
< div
58
59
ref = { ( ref ) => {
@@ -68,7 +69,7 @@ const Output: FC<OutputProps> = ({
68
69
key = { index }
69
70
>
70
71
< QRCode
71
- value = { line }
72
+ value = { line . trim ( ) }
72
73
color = { color }
73
74
bgColor = { bgColor }
74
75
bordered = { bordered }
@@ -82,7 +83,7 @@ const Output: FC<OutputProps> = ({
82
83
) )
83
84
) : (
84
85
< QRCode
85
- value = { value }
86
+ value = { trimmedValue }
86
87
color = { color }
87
88
bgColor = { bgColor }
88
89
bordered = { bordered }
Original file line number Diff line number Diff line change @@ -101,7 +101,7 @@ const UserInputs: FC<UserInputsProps> = ({
101
101
< TextArea
102
102
value = { value }
103
103
rows = { 7 }
104
- onChange = { ( e ) => setValue ( e . target . value . trim ( ) ) }
104
+ onChange = { ( e ) => setValue ( e . target . value ) }
105
105
data-gramm = { false }
106
106
placeholder = "Enter input"
107
107
allowClear
You can’t perform that action at this time.
0 commit comments