Skip to content

Conversation

@nicolaihenriksen
Copy link
Contributor

Fixes #3675

This is the remaining fix for the issue above. This is regarding the hint in the ComboBox not moving accordingly when the "selected content" changes from a single line element to a multi-line element.

The fundemental issue is that the converter in the SmartHint needs some knowledge about when the "host element" changes is size. This is not directly available via the SmartHint.HintProxy abstraction, and therefore I have added a SmartHint.HintHost which is essentially pointing to the same element, but not hidden behind an abstraction. As we've discussed, we could phase out the use of IHintProxy and replace with the SmartHint.HintHost instead (with some supporting methods).

HintHost.ActualWidth and HintHost.ActualHeight have both been added as "trigger bindings" to the converter calculating the hint position (the values are not used; they simply re-trigger the calculation)

@nicolaihenriksen nicolaihenriksen added this to the 5.2.0 milestone Oct 7, 2024
@nicolaihenriksen nicolaihenriksen changed the title Fix3675 part3 [SmartHint] Fix hint placement when ComboBox toggles between single-line and multi-line selection Oct 8, 2024
@Keboo Keboo merged commit df00283 into master Oct 9, 2024
2 checks passed
@Keboo Keboo deleted the fix3675-part3 branch October 9, 2024 04:29
JLdgu pushed a commit to JLdgu/MaterialDesignInXamlToolkit that referenced this pull request Nov 8, 2024
…ine and multi-line selection (MaterialDesignInXAML#3690)

* Add SmartHint.HintHost

* Use SmartHint.HintHost to trigger hint position recalculation

* Set SmartHint.HintHost in ComboBox style

* Set SmartHint.HintHost in TextBox and AutoSuggestBox styles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unpredictable behavior of multiline ComboBox with hint

3 participants