-
Notifications
You must be signed in to change notification settings - Fork 705
Revisit v2 Cancelable Event Pattern - was KeyDown and MouseEvent no longer fires for Listbox #3950
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Do you mean the user can by pass or change the |
Yes, l think event should always have first priority since user can put anything in there. |
For ListView the code for collection navigator is in: protected override bool OnKeyDown (Key a) This means that even keybindings don't get priority over navigation, the ordering is controlled in base class so cannot be simply fixed for ListView alone: // This is where navigation happens
if (RaiseKeyDown (key) || key.Handled)
{
return true;
}
// This is where keybindings happen
if (InvokeCommands (key) is true || key.Handled)
{
return true;
} View.Keyboard.cs This means that even this test fails: [Fact]
public void ListViewCollectionNavigatorMatcher_KeybindingsOverrideNavigator ()
{
ObservableCollection<string> source = new () { "apricot", "arm", "bat", "batman", "bates hotel", "candle" };
ListView lv = new ListView { Source = new ListWrapper<string> (source) };
lv.KeyBindings.Add (Key.B,Command.Down);
Assert.Equal (-1, lv.SelectedItem);
// Keys should be consumed to move down the navigation i.e. to apricot
Assert.True (lv.NewKeyDownEvent (Key.B));
Assert.Equal (0, lv.SelectedItem);
// There is no keybinding for Key.C so it hits collection navigator i.e. we jump to candle
Assert.True (lv.NewKeyDownEvent (Key.C));
Assert.Equal (5, lv.SelectedItem);
} |
Two things:
Instead, based on the new The thing that shows the list of suggestions should just be a ListView, Registered with I believe this will fix this issue. |
I think this is unrelated to popups, at least as far as the test above. It is about KeystrokeNavigator having precedence over both Keybindings and user KeyDown event handlers... KeystrokeNavigator is the thing that moves selection when you press key i.e. to the next object that begins with that letter |
See here: #4027 (comment) The fix does not belong to this Issue. |
Describe the bug
Works for arrow keys but not letters
Issue is probably that keybindings, mousebindings and collection navigator consume the events before the users event.
I think that when the user has an explicit event tied to these then they should get priority.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
enter callback
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
Add any other context about the problem here.
Set Project & Milestone
If you have access, please don't forget to set the right Project and Milestone.
The text was updated successfully, but these errors were encountered: