Hi All,
I'm trying a scenario where I type a message on the text input and hit enter button on keyboard, the text moves to the next line in the HTML text control.
Note: a line break functionality is in place where the line breaks and move to next line after 25 characters.
Could anyone give me some guidance on how to proceed further?
Thanks in advance!
Solved! Go to Solution.
Hi @Shivakumarcm1 ,
Not the prettiest, but I think this does the job you need it to do:
Clear(colValues);
Clear(colLines);
ForAll(
Substitute(
Split(
TextInput1.Text,
""
),
Char(10),
"<br>"
) As _Characters,
Collect(
colValues,
_Characters.Result
);
If(
_Characters.Result = "<br>",
Collect(
colLines,
Concat(
colValues,
Value
)
);
RemoveIf(
colValues,
true
)
);
If(
CountRows(colValues) = 25,
Collect(
colValues,
"<br>"
);
Collect(
colLines,
Concat(
colValues,
Value
)
);
RemoveIf(
colValues,
true
)
)
);
Collect(
colLines,
Concat(
colValues,
Value
)
);
UpdateContext(
{
_htmlinput: Concat(
FirstN(
colLines,
5
),
Value
) & If(
CountRows(colLines) > 5,
"..."
)
}
)
HI @Shivakumarcm1 ,
Do you want the counter of 25 to be reset after the user inserted a line break or should it continue?
Example with reset:
1234567890123456789012345
1234567890
1234567890123451234567890
1234567890123451234567890
Example without reset:
1234567890123456789012345
1234567890
123456789012345
1234567890123456789012345
1234567890123456789012345
Hi BCBuizer,
If i type the text in continuously, it has to break after 25 characters and move to the next line and start counting from 1 again.
if i click enter in the Textinput, the line breaks and move to the next line and starts counting from 1 again.
It has to be with reset as example 1 that you have shared above.
Is there any possibility to set maximum line limit to 5?
I tried couple of different codes suggested in google but didn't help.
code:
display: -webkit-box;
-webkit-line-clamp: 2; // <- you can change rows number
-webkit-box-orient: vertical;
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
Hi @Shivakumarcm1 ,
Not the prettiest, but I think this does the job you need it to do:
Clear(colValues);
Clear(colLines);
ForAll(
Substitute(
Split(
TextInput1.Text,
""
),
Char(10),
"<br>"
) As _Characters,
Collect(
colValues,
_Characters.Result
);
If(
_Characters.Result = "<br>",
Collect(
colLines,
Concat(
colValues,
Value
)
);
RemoveIf(
colValues,
true
)
);
If(
CountRows(colValues) = 25,
Collect(
colValues,
"<br>"
);
Collect(
colLines,
Concat(
colValues,
Value
)
);
RemoveIf(
colValues,
true
)
)
);
Collect(
colLines,
Concat(
colValues,
Value
)
);
UpdateContext(
{
_htmlinput: Concat(
FirstN(
colLines,
5
),
Value
) & If(
CountRows(colLines) > 5,
"..."
)
}
)