vain0x / DotNetKit.Wpf.AutoCompleteComboBox

ComboBox with filtering (auto-complete) for WPF
MIT License
71 stars 26 forks source link

Focus issue (cursor won't "blink") #5

Closed RobertPaulson90 closed 6 years ago

RobertPaulson90 commented 6 years ago

Hello! Awesome package here. Sadly there is a bug where cursor won't blink sometimes. It's only after I type the first letter.

This might be helpful: https://stackoverflow.com/questions/8010272/textbox-cursor-is-not-blinking

RobertPaulson90 commented 6 years ago

Sorry the issue was related to my own custom styling. A question: is it possible to only update SelectedItem upon "enter". Up or Down arrows triggers an event in the UI which closes the dropdown. I'd like the dropdown to stay open until a users click or presses enter.

vain0x commented 6 years ago

Thanks for your feedback.

Blink Issue

Is the issue (the cursor not blinking) solved? i.e., is there something to be fixed in the library? If yes, could you give me a small XAML code that reproduce it?

Dropdown Issue

I'd like the dropdown to stay open until a users click or presses enter.

As far as I tried, once the dropdown opens, it doesn't close until the (Enter | Ctrl+Space) key press or user's click. Did you mean that when the SelectedItem changed, you want to know whether the user selected it or just moving selection?

Regards, @vain0

RobertPaulson90 commented 6 years ago

Thanks for the reply. Your UI component is really nice. Regarding my dropdown issue - yes exactly. It should be 2 different bindings "SelectedItem" & "HighlightedItem". Right now, SelectedItem functions as HighlightedItem, and this gives me issues. Problem is my app have a bunch of things happening when the object is updated, and it causes UI lag and worse, the dropdown to close. So ideally, I only want the SelectedItem to become a new object when the user actually selects it with click or enter, not just highlighting it.

RobertPaulson90 commented 6 years ago

I would give more info for the blink issue, but I don't think you should spend time on it, since it's related to this style code we have applied: https://gist.github.com/amivit/7f4b8e8fe67345c7e6bff3c54861a9cc

vain0x commented 6 years ago

I see. To solve, I think that additional key/click event listeners are necessary, to handle "user's select" strictly. Event listening don't need modification to this library.

Because it doesn't seem easy to correct the behavior of SelectedItem, attached properties will meet your needs. i.e., add new attached property and add event listeners to update its value.

Note that, in MVVM, adding event listener to already-defined control can be done with behaviors (using the Blend library) or WPF attached properties.

And thanks for code-snippet.

RobertPaulson90 commented 6 years ago

Alrighty, thanks. I will try to modify my code for specific enter/click listening. I'm new to WPF so a lot to learn, but great to hear that it's possible without any need for modifying the library.