Materialdesigninxamltoolkit: TextBox does not show cursor at rightmost position

Created on 11 Sep 2018  路  4Comments  路  Source: MaterialDesignInXAML/MaterialDesignInXamlToolkit

In a TextBox, the cursor/caret is not shown if its at the rightmost position. This happens in the following cases:

  • If you fill the TextBox
  • If the TextBox content is right-aligned and empty
  • If the TextBox content is right-aligned and the cursor is at the rightmost position

This can easily be reproduced in the Fields tab of the demo project in this repo.

caret

Hacktoberfest bug

Most helpful comment

This appears to be caused by the TextFieldAssist.TextBoxViewMargin property defaulting to "0 0 0 0". After I test to ensure that change does not break anything else I can get a fix in.

As an immediate work around you can set that attached property on your text boxes to "1 0 1 0" which should address the problem.

All 4 comments

This appears to be caused by the TextFieldAssist.TextBoxViewMargin property defaulting to "0 0 0 0". After I test to ensure that change does not break anything else I can get a fix in.

As an immediate work around you can set that attached property on your text boxes to "1 0 1 0" which should address the problem.

Wouldn't 0 0 1 0 suffice? It's only a problem on the right-hand side. Or is it for keeping things symmetrical?

Mostly thinking that would keep things symmetrical. I need to spend some time actually digging into why that margin is causing the problem to know for sure though (or if someone else wants to do it that would be great). I only debugged far enough to determine the cause. It is adjusting the margin for the control inside of the TextBox's ScrollView, so it might not visually make a difference if it is 1 0 1 0 or 0 0 1 0.

Ok. To be clear, I'm fine with this being fixed simply using 1 0 1 0.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Xaalek picture Xaalek  路  3Comments

TFTomSun picture TFTomSun  路  4Comments

mgnslndh picture mgnslndh  路  3Comments

Prathik-Jain picture Prathik-Jain  路  5Comments

MoshiMoshi0 picture MoshiMoshi0  路  4Comments