You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not crazy! I will not fill out this form just to ask a question or request a feature. Pinky promise.
Is there an existing issue for this?
I have searched the existing issues.
Is this issue related to iced?
My hardware is compatible and my graphics drivers are up-to-date.
What happened?
text_editor::Content::text() appends a newline character ('\n') to the end of the returned string if there is not one present.
This causes issues/inconsistencies when the actual content of the text_editor genuinely ends with a newline character.
For example, if I have a text_editor with no content in it, it displays on the screen as a box with a single line. At this point calling text() on its content returns a string with a length of 1 and content of "\n".
If I then focus on the text_editor and hit return, the display correctly changes to a box with two lines. At this point, however, calling text() on the content returns a string with a length of 1 and content of "\n".
Clearly at this stage the actual content of the text_editors is different but I have no way of determining this when calling text() as it returns identical results for two different situations.
Is your issue REALLY a bug?
Is there an existing issue for this?
Is this issue related to iced?
What happened?
text_editor::Content::text()
appends a newline character ('\n') to the end of the returned string if there is not one present.This causes issues/inconsistencies when the actual content of the
text_editor
genuinely ends with a newline character.For example, if I have a
text_editor
with no content in it, it displays on the screen as a box with a single line. At this point callingtext()
on its content returns a string with a length of 1 and content of "\n".If I then focus on the text_editor and hit return, the display correctly changes to a box with two lines. At this point, however, calling
text()
on the content returns a string with a length of 1 and content of "\n".Clearly at this stage the actual content of the
text_editor
s is different but I have no way of determining this when callingtext()
as it returns identical results for two different situations.This issue is due to the check on lines 410-412 of widget/src/text_editor.rs:
What is the expected behavior?
I expect to be able to unambiguously determine the content of the
text_editor
and relate it correctly to what is displayed on the screen.Options I can see for this are:
text()
, allowing the consumer to handle removing the newline to get to the actual contentPersonally, I would prefer that the response didn't add the newline so that what is returned to me is what is actually in the
text_editor
.Version
master
Operating System
Linux
Do you have any log output?
The text was updated successfully, but these errors were encountered: