Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

[Shell] Control loses focus after appearing #4755

Open
davidortinau opened this issue Dec 15, 2018 · 1 comment
Open

[Shell] Control loses focus after appearing #4755

davidortinau opened this issue Dec 15, 2018 · 1 comment
Labels
4.0.0 regression on 4.0.0 a/shell 🐚 e/4 🕓 4 help wanted We welcome community contributions to any issue, but these might be a good place to start! inactive Issue is older than 6 months and needs to be retested t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!

Comments

@davidortinau
Copy link
Contributor

davidortinau commented Dec 15, 2018

Description

I have a page that sets focus to an Entry and then pre-selects text. This works fine in a TabbedPage, but within Shell it's losing focus.

Losing focus:
https://www.screencast.com/t/Daq7XY40

protected override void OnAppearing()
        {
            base.OnAppearing();
            MakeSelection();
        }

        private void MakeSelection()
        {
            FirstEntry.Focus();
            FirstEntry.CursorPosition = 4;
            FirstEntry.SelectionLength = 11;
        }

If I set the ShellContent to be ShellSections (bottom tabs) and yet also displayed in the flyout, this is not a problem. It seems navigation from ShellItem to ShellItem introduces an animation that is causing this issue.

Not losing focus: https://www.screencast.com/t/GBJOIi9a

This is fine:

<Shell ...>
<ShellItem FlyoutDisplayOptions="AsMultipleItems" Title="Releases">
        <ShellContent Title="3.1.0" ContentTemplate="{DataTemplate views:ThreeOnePage}" Icon="iconXamagon"/>
        <ShellContent Title="3.2.0" ContentTemplate="{DataTemplate views:ThreeTwoPage}" Icon="iconXamagon"/>
        <ShellContent Title="3.3.0" ContentTemplate="{DataTemplate views:ThreeThreePage}" Icon="iconXamagon"/>
        <ShellContent Title="3.4.0" ContentTemplate="{DataTemplate views:ThreeFourPage}" Icon="iconXamagon"/>
        <ShellContent Title="3.5.0-pre" ContentTemplate="{DataTemplate views:ThreeFivePage}" Icon="iconXamagon"/>
    </ShellItem>
</Shell>

This is not:

<Shell ...>
        <ShellContent Title="3.1.0" ContentTemplate="{DataTemplate views:ThreeOnePage}" Icon="iconXamagon"/>
        <ShellContent Title="3.2.0" ContentTemplate="{DataTemplate views:ThreeTwoPage}" Icon="iconXamagon"/>
        <ShellContent Title="3.3.0" ContentTemplate="{DataTemplate views:ThreeThreePage}" Icon="iconXamagon"/>
        <ShellContent Title="3.4.0" ContentTemplate="{DataTemplate views:ThreeFourPage}" Icon="iconXamagon"/>
        <ShellContent Title="3.5.0-pre" ContentTemplate="{DataTemplate views:ThreeFivePage}" Icon="iconXamagon"/>
</Shell>

Steps to Reproduce

  1. Navigate to the 3.2.0 page from the flyout

Expected Behavior

Focus set in OnAppearing is not lost until the user changes focus..

Actual Behavior

Focus is lost a split second after appearing.

Basic Information

  • Version with issue: 4.0-pre1

Screenshots

https://www.screencast.com/t/Daq7XY40

https://www.screencast.com/t/GBJOIi9a

Reproduction Link

Archive.zip

Parent: #2415

@samhouts samhouts added this to the 4.0.0 milestone Jan 10, 2019
@samhouts samhouts added the e/4 🕓 4 label Mar 2, 2019
@davidortinau davidortinau added the blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. label Mar 14, 2019
@PureWeen PureWeen modified the milestone: 4.0.0 Mar 22, 2019
@samhouts
Copy link
Member

samhouts commented May 1, 2019

@davidortinau I can't get this project to build. It dislikes me. :P

@samhouts samhouts added the 4.0.0 regression on 4.0.0 label Sep 12, 2019
@samhouts samhouts removed this from the 4.0.0 milestone Sep 12, 2019
@samhouts samhouts removed the blocker Issue blocks next stable release. Prioritize fixing and reviewing this issue. label Oct 8, 2019
@samhouts samhouts added inactive Issue is older than 6 months and needs to be retested help wanted We welcome community contributions to any issue, but these might be a good place to start! up-for-grabs We welcome community contributions to any issue, but these might be a good place to start! labels Oct 28, 2019
@samhouts samhouts added this to the 5.0.0 milestone Aug 13, 2020
@samhouts samhouts removed this from the 5.0.0 milestone Nov 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
4.0.0 regression on 4.0.0 a/shell 🐚 e/4 🕓 4 help wanted We welcome community contributions to any issue, but these might be a good place to start! inactive Issue is older than 6 months and needs to be retested t/bug 🐛 up-for-grabs We welcome community contributions to any issue, but these might be a good place to start!
Projects
None yet
Development

No branches or pull requests

3 participants