Skip to content
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

Keyboard up/down in textbox in floating anchorable focusing DropDownControlArea #225

Closed
Muhahe opened this issue Jan 8, 2021 · 3 comments

Comments

@Muhahe
Copy link
Contributor

Muhahe commented Jan 8, 2021

Hi there,

i noticed strange behavior in your avalondock version when i have textbox in floating LayoutAnchorable.
If textbox in floating layoutAnchorable has focus and you prey keyup/keydown this textbox loses focus (even if textbox has multiple rows and caret should move to next/previous line).

in this case, caret is in "second line" and key up/down will result into focus lost of textbox and dropDownAreaControl is focused instead (i checked that in Snoop).
image

If anchorable is docked or there are multiple anchorables joined together, up/down arrows works.
image

There you can find modified test app (but i only added textbox into properties window)

I noticed same behavior for combobox (also in example and richtextbox). And tried this in edi version 01_02 and didnt notice this behavior...

@Muhahe Muhahe changed the title Mouse up/down in textbox in floating anchorable focusing DropDownControlArea Keyboard up/down in textbox in floating anchorable focusing DropDownControlArea Jan 11, 2021
@bdachev
Copy link
Contributor

bdachev commented Feb 3, 2021

We also encounter that problem so I tracked it down to be introduced in 64b30e7 by @LyonJack and in particular by changing the base type of DropDownControlArea class from UserControl to ContentControl.
So before creating a pull request I would like to ask why was that done so and whether it was needed for the main change or @LyonJack had just decided that there is no additional functionality in UserControl and DropDownControlArea can inherit from ContentControl as simpler base class.
It is also quite interesting why the problem is gone using UserControl but I don't want to dig into M$ implementation to check that.

@LyonJack
Copy link
Contributor

LyonJack commented Feb 4, 2021

I have maket sure that bug,I set the title bar‘s 'Focusable' as false,that make it not get the focus

@LyonJack LyonJack mentioned this issue Feb 4, 2021
@bdachev
Copy link
Contributor

bdachev commented Feb 4, 2021

Hi @LyonJack, I can see that you have changed Focusable to false in generic.xaml of AvalonDock library and only inside the template of LayoutAnchorableFloatingWindowControl. That would probably mean that if a theme is applied the problem will reoccur and also it is not clear if in other usages of DropDownControlArea we won't see the same issue.
I would suggest to change the default value of Focusable to false in static constructor of DropDownControlArea like that:

  static DropDownControlArea()
  {
    FocusableProperty.OverrideMetadata(typeof(DropDownControlArea), new FrameworkPropertyMetadata(false));
  }

That way it will be 'automatically` changed to false in all XAMLs and places of usage and we avoid the need to do changes in many places.

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

No branches or pull requests

4 participants