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
@tanguyhardion I just had a brief look at this. The TextBox styles in MDIX seem to have been designed for "their default size". This means that when you start modifying things like Padding, FontSize, and Height (in particular), the hint and icon placements are affected in ways that do not always look good. I have tested your code going all the way back to version 4.0.0 where the leading icon was introduced, and all versions have (different) issues.
There has recently been done some work refactoring the SmartHint and the placement of it. Some of that is not yet released, but even on the latest (not released) code, there are still issues when using the code you provided. When I have some time, I will look into adding a bit better support for things like this, although I believe it will be difficult to land a solution that works perfectly in all scenarios.
@tanguyhardion In the code you provided, you are explicitly setting FontSize. This is one of the remaining issues that I did not tackle 100% in the PR that was merged. You may run into issues with it, especially if you combine it with Height and VerticalContentAlignment properties.
If you do use some custom values, you can always play around with setting a custom HintAssist.FloatingOffset as well. This will allow you full control of the (relative) placement of the floated hint. The default is (0,-16) I believe, and this is a special value which receives special handling. So if you want custom handling, you need to set it to something different. In the rare case that you actually need it to be manually positioned at (0,-16) you can probably just set the value to (0, -16.001) or something like that to avoid the "special handling case"; This is a side-effect of a somewhat unfortunate default value of the DP in my opinion, but there are probably reasons for it being the way it is.
Activity
nicolaihenriksen commentedon Apr 25, 2023
@tanguyhardion I just had a brief look at this. The
TextBoxstyles in MDIX seem to have been designed for "their default size". This means that when you start modifying things likePadding,FontSize, andHeight(in particular), the hint and icon placements are affected in ways that do not always look good. I have tested your code going all the way back to version 4.0.0 where the leading icon was introduced, and all versions have (different) issues.There has recently been done some work refactoring the
SmartHintand the placement of it. Some of that is not yet released, but even on the latest (not released) code, there are still issues when using the code you provided. When I have some time, I will look into adding a bit better support for things like this, although I believe it will be difficult to land a solution that works perfectly in all scenarios.nicolaihenriksen commentedon May 11, 2023
@tanguyhardion In the code you provided, you are explicitly setting
FontSize. This is one of the remaining issues that I did not tackle 100% in the PR that was merged. You may run into issues with it, especially if you combine it withHeightandVerticalContentAlignmentproperties.If you do use some custom values, you can always play around with setting a custom
HintAssist.FloatingOffsetas well. This will allow you full control of the (relative) placement of the floated hint. The default is (0,-16) I believe, and this is a special value which receives special handling. So if you want custom handling, you need to set it to something different. In the rare case that you actually need it to be manually positioned at (0,-16) you can probably just set the value to (0, -16.001) or something like that to avoid the "special handling case"; This is a side-effect of a somewhat unfortunate default value of the DP in my opinion, but there are probably reasons for it being the way it is.