Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About line break codes and maximum number of characters in WPF text boxes #10211

Open
vsfeedback opened this issue Dec 30, 2024 · 0 comments
Open
Labels
Investigate Requires further investigation by the WPF team.

Comments

@vsfeedback
Copy link

vsfeedback commented Dec 30, 2024

This issue has been moved from a ticket on Developer Community.


If AcceptsReturn is set to true in a WPF text box, input exceeding MaxLength will be possible in the following situation.

AcceptsReturn=true
MaxLength=4

1.Enter the following two lines in Text
a
b

  1. With the caret at the beginning of the second line, press SHIFT+LEFT on the keyboard to select only the line break part.

3.Enter "c"

This operation allows input exceeding MaxLength.


Repro

  1. Create a new WPF application.
  2. Add a TextBox control to the main window.
  3. Set the AcceptsReturn property of the TextBox to true.
  4. Set the MaxLength property of the TextBox to a specific value, such as 4.
  5. Run the application.
  6. In the TextBox, enter a multi-line text:
  7. Type "a" on the first line.
  8. Press Enter to move to the second line.
  9. Type "b" on the second line.
  10. Place the cursor at the beginning of the second line (before the "b").
  11. Press SHIFT+LEFT to select the line break.
  12. Enter any character.

At this point, you should observe that the input exceeds the set MaxLength.

Original Comments

Feedback Bot on 4/11/2024, 07:28 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

@harshit7962 harshit7962 added the Investigate Requires further investigation by the WPF team. label Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Investigate Requires further investigation by the WPF team.
Projects
None yet
Development

No branches or pull requests

2 participants