DotNetKit.Wpf.AutoCompleteComboBox icon indicating copy to clipboard operation
DotNetKit.Wpf.AutoCompleteComboBox copied to clipboard

Item selection in ComboBox breaks if DisplayMemberPath and TextSearch.TextPath point to different properties

Open thatgim opened this issue 4 years ago • 1 comments

https://github.com/vain0x/DotNetKit.Wpf.AutoCompleteComboBox/blob/39e1f0e2bfbf1f5dbc1bac1e5cf87e2f4d8a728d/DotNetKit.Wpf.AutoCompleteComboBox/Windows/Controls/AutoCompleteComboBox.xaml.cs#L173 text gets filled by resolving DisplayMemberPath and TextFromItem(SelectedItem) gets filled by resolving TextSearch.TextPath. If these properties aren't set to the same/equivalent properties SelectedItem gets unset immediatly after selection.

I tried removing TextFromItem(SelectedItem) == text and it fixed this problem and didn't introduce any new problem as far as I can tell.

thatgim avatar Jun 23 '21 12:06 thatgim

Thanks for suggestion.

I tried to reproduce your situation (SelectedItem is unset) in the demo app but couldn't...: https://github.com/vain0x/DotNetKit.Wpf.AutoCompleteComboBox/commit/08c474560c42d562ce835354529e1aa8736b49bf It seems Text is filled by resolving TextPath rather than DisplayPath, as TextFromItem is.

I would be glad if a reproduction code is given.

vain0x avatar Jun 27 '21 01:06 vain0x

Closing since not reproduced. Feel free to reopen if someone want to discuss about this.

vain0x avatar Apr 02 '23 02:04 vain0x