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

TeachingTip does not display on the target control and IsOpen can't be set from markup #538

Closed
lukeblevins opened this issue Apr 7, 2019 · 8 comments
Assignees
Labels
area-TeachingTip bug Something isn't working team-Controls Issue for the Controls team

Comments

@lukeblevins
Copy link
Contributor

Describe the bug
Targeting a teaching tip to a control may display the TeachingTip elsewhere.

Steps to reproduce the bug
I'm unaware of a pattern that can be replicated.

Expected behavior
The TeachingTip should mount/attach itself to the targeted control-in the correct position.

Screenshots
This screenshot shows the teaching tip, which is targeting the bottom of the "Navigate to a path..." TextBox displayed in an incorrect position.
Annotation 2019-04-07 191101

Version Info

NuGet package version:
Microsoft.UI.Xaml 2.1.190405004

Windows 10 version Saw the problem?
Insider Build (18362.30) Yes
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Anniversary Update (14393)
Device form factor Saw the problem?
Desktop Yes
Mobile
Xbox
Surface Hub
IoT

Additional context
Code snippet of problem:

<TextBox Grid.Column="1" CornerRadius="0" KeyDown="VisiblePath_TextChanged" Style="{StaticResource TextBoxStyleForPathBar}" BorderThickness="1" x:Name="VisiblePath" Text="{x:Bind local:App.PathText.Text, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" FontFamily="Segoe UI" FontWeight="SemiBold" FontSize="14" ScrollViewer.VerticalScrollBarVisibility="Hidden" ScrollViewer.HorizontalScrollBarVisibility="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Center" Padding="5" Margin="2,5" PlaceholderText="Navigate to a path...">
       <TextBox.Resources>
              <uilib:TeachingTip Target="{x:Bind VisiblePath}" x:Key="PathBarTeachingTip" Name="PathBarTip" PreferredPlacement="Bottom" Subtitle="Enter a full path or simply the name of a common location" Title="Access locations quickly">
                     <uilib:TeachingTip.IconSource>
                           <uilib:SymbolIconSource Symbol="Help"/>
                     </uilib:TeachingTip.IconSource>
               </uilib:TeachingTip>
       </TextBox.Resources>
</TextBox>

@msft-github-bot msft-github-bot added this to Needs triage in Controls Triage Apr 7, 2019
@jevansaks
Copy link
Member

@duke7553 thanks for the bug report! I tried your snippet and wasn't able to repro. When are you setting IsOpen=true? I could believe there is a timing issue where perhaps the TextBox isn't at its final layout position when we try to calculate the TeachingTip position, but I'd like to make sure that's what you're seeing. Do you have an app we could install and debug through?

@jevansaks jevansaks added area-TeachingTip bug Something isn't working labels Apr 8, 2019
@jevansaks jevansaks moved this from Needs triage to Investigate / needs follow-up in Controls Triage Apr 8, 2019
@msft-github-bot msft-github-bot added the needs-assignee-attention Assignee needs to follow-up or investigate this issue label Apr 8, 2019
@lukeblevins
Copy link
Contributor Author

Yes, I do have a public app that has this problem.

  1. Check out the source code at the "newui" branch found here: https://github.com/duke7553/files-uwp/tree/newui
  2. In the file ProHome.xaml.cs, find the constructor and set the PathBarTip.IsOpen property to true
  3. You can now execute the app and discover the bug.

Thanks for your help.
UNRELATED: The sample app is a project of mine developed during my free time. Many components still don't work on the newui branch, so feel free to download a more stable release from the repo page if you're interested.

@lukeblevins
Copy link
Contributor Author

I also noticed setting the IsOpen property from markup fails completely.

@lukeblevins
Copy link
Contributor Author

lukeblevins commented Apr 18, 2019

@jevansaks ProHome.RibbonTeachingTip is the updated name in the project in case you were wondering.

@jevansaks
Copy link
Member

Thanks! @StephenLPeters can you debug this project too?

@jevansaks jevansaks moved this from Investigate / needs follow-up to Approved - Assigned in Controls Triage Apr 18, 2019
@msft-github-bot msft-github-bot removed the needs-assignee-attention Assignee needs to follow-up or investigate this issue label Apr 18, 2019
@jevansaks
Copy link
Member

2. In the file ProHome.xaml.cs, find the constructor and set the PathBarTip.IsOpen property to true

I think this is the issue. We need to defer calculating position and stuff until everything is loaded. I don't see a bug tracking this so we'll use this.

@jevansaks
Copy link
Member

@duke7553 To work around this, don't set IsOpen until the Loaded event.

@lukeblevins
Copy link
Contributor Author

@jevansaks Thanks! This did the trick.

@jevansaks jevansaks moved this from Approved - Assigned to Approved in Controls Triage May 7, 2019
@YuliKl YuliKl changed the title TeachingTip does not display on the target control TeachingTip does not display on the target control and IsOpen can't be set from markup May 23, 2019
@jevansaks jevansaks added the team-Controls Issue for the Controls team label Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-TeachingTip bug Something isn't working team-Controls Issue for the Controls team
Projects
No open projects
Development

No branches or pull requests

4 participants