1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 12:57:36 +08:00

Fix search textboxes absorbing home/end input on scroll contain… (#7403)

Fix search textboxes absorbing home/end input on scroll containers
This commit is contained in:
Dean Herbert 2019-12-31 22:00:36 +09:00 committed by GitHub
commit 3c30238eb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -34,11 +34,21 @@ namespace osu.Game.Graphics.UserInterface
public override bool OnPressed(PlatformAction action)
{
// Shift+delete is handled via PlatformAction on macOS. this is not so useful in the context of a SearchTextBox
// as we do not allow arrow key navigation in the first place (ie. the caret should always be at the end of text)
// Avoid handling it here to allow other components to potentially consume the shortcut.
if (action.ActionType == PlatformActionType.CharNext && action.ActionMethod == PlatformActionMethod.Delete)
return false;
switch (action.ActionType)
{
case PlatformActionType.LineEnd:
case PlatformActionType.LineStart:
return false;
// Shift+delete is handled via PlatformAction on macOS. this is not so useful in the context of a SearchTextBox
// as we do not allow arrow key navigation in the first place (ie. the caret should always be at the end of text)
// Avoid handling it here to allow other components to potentially consume the shortcut.
case PlatformActionType.CharNext:
if (action.ActionMethod == PlatformActionMethod.Delete)
return false;
break;
}
return base.OnPressed(action);
}