question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Focus is completely lost with Teaching tip

See original GitHub issue

I am using the Teaching Tip control in a UWP app. However, I am not able to get focus on the teaching tip. As suggested in the documentation, pressing F6 does not help. The focus is completely lost and I am not able to navigate using the tab key even in the rest of the app. The only option is to press the Esc key which dismisses the teaching tip.

The reason I suspect this happens is because the “IsLightDismissEnabled” property is set to True, hence there is no cross button on the top right corner. Moreover, I do not use the “ActionButton” or the “CloseButton”. If I have any of those, then the focus gets set on pressing F6. I have my own custom content in the Teaching tip -

<muxc:TeachingTip
            x:Name="TestTip"
            Title="Sample Title"
            Target="{x:Bind TaskEntryBar.PlusIcon}"
            PreferredPlacement="TopRight"
            IsLightDismissEnabled="True">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <TextBlock Grid.Column="0" Text="2 of 2" FontSize="14"/>
                <Button
                    x:Name="TestButton"
                    Grid.Column="1"
                    FontSize="14"
                    Margin="6,0"
                    Content="Got it"
                    Click="AddTaskTip_Click" />
            </Grid>
</muxc:TeachingTip>

image

As suggested in one of the other issues, I tried to set the focus ( in the code behind file ) on my custom button but that also did not work -

TestTip.IsOpen = true;
TestButton.Focus(FocusState.Programmatic);

And using the visual tree helper, I got the popup, but Focus() method is not available on a popup.

var popups = VisualTreeHelper.GetOpenPopups(Window.Current);
foreach (var popup in popups)
{
    popup.Focus(FocusState.Programmatic);
}

Please suggest what can I do to get focus on the teaching tip in case of only custom content and with IsLightDismissEnabled set to true.

Windows 10 Version: Build 19041.450 Device Form Factor: Desktop

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:12 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Felix-Devcommented, Sep 9, 2020

Definitely should be added to the TeachingTip’s main documentation page then. Can open a PR for that later today.

0reactions
GuildOfCalamitycommented, May 4, 2023

This is especially problematic in a WinUI app for the TextBox controls since is causes the user to have to click the TextBox twice.

The only way I know to get around this is to setup a PropertyChangedCallback for the teaching tip…

teachingTip.RegisterPropertyChangedCallback(TeachingTip.IsOpenProperty, IsTipOpenChanged);

Then inside the callback shift the focus back to the TextBox.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I can't concentrate what my teacher is teaching in class ...
How do I focus on studying? My exams are in 15 days but I'm still not studying. What are your tips to focus...
Read more >
7 Ways to Increase a Student's Attention Span
If you notice a child that is regularly losing focus during challenging tasks, here are some strategies that might help increase that ...
Read more >
9 Ways to Stay Focused in Class
2. Eliminate distractions ... When you lose focus in class, what do you end up doing instead? Do you try to sneak a...
Read more >
The Two Things Teachers Focus on Most....Instead of ...
Behavioral expectations on steroids aren't the only thing that can cause a classroom teacher to lose focus either. Before you ask your students...
Read more >
I Want To Study, But I Cannot Focus. What Should I Do?
Keep calm. If you're distracted and can't concentrate, take a slow deep breath to help you calm down. · Isolate the problem ·...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found