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

[Android] NavigationView doesn't initially update Flyout position #18024

Closed
morning4coffe-dev opened this issue Aug 26, 2024 · 8 comments · Fixed by #18539
Closed

[Android] NavigationView doesn't initially update Flyout position #18024

morning4coffe-dev opened this issue Aug 26, 2024 · 8 comments · Fixed by #18539
Assignees
Labels
area/navigationview 🧭 Categorizes an issue or PR as relevant to the NavigationView control difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform project/pointers 🖱️ Categorizes an issue or PR as relevant to mouse/touch/pen pointers triage/untriaged Indicates an issue requires triaging or verification

Comments

@morning4coffe-dev
Copy link
Member

morning4coffe-dev commented Aug 26, 2024

Current behavior

Screen.Recording.2024-08-26.142847.mp4

Expected behavior

No response

How to reproduce it (as minimally and precisely as possible)

  <NavigationView PaneDisplayMode="LeftCompact">
    <NavigationView.MenuItems>
      <NavigationViewItem Content="Home" Icon="Home" Tag="Home" />
      <NavigationViewItem Content="Sub Menu 1" Icon="Keyboard" ToolTipService.ToolTip="Sub Menu 1">
        <NavigationViewItem.MenuItems>
          <NavigationViewItem Content="Notes" Icon="Page" ToolTipService.ToolTip="Notes"/>
          <NavigationViewItem Content="Mail" Icon="Mail" ToolTipService.ToolTip="Mail"/>
          <NavigationViewItem Content="Sub Menu 2" Icon="AllApps" ToolTipService.ToolTip="Sub Menu 2">
            <NavigationViewItem.MenuItems>
              <NavigationViewItem Content="Calendar" Icon="Calendar" ToolTipService.ToolTip="Calendar"/>
              <NavigationViewItem Content="Contacts" Icon="Contact" ToolTipService.ToolTip="Contacts"/>
            </NavigationViewItem.MenuItems>
          </NavigationViewItem>
        </NavigationViewItem.MenuItems>
        </NavigationViewItem.MenuItems>
      </NavigationViewItem>
    </NavigationView.MenuItems>
    <Frame x:Name="ContentFrame" />
  </NavigationView>

Workaround

No response

Works on UWP/WinUI

Yes

Environment

No response

NuGet package version(s)

No response

Affected platforms

Android, iOS?

IDE

Visual Studio 2022

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

@morning4coffe-dev morning4coffe-dev added kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Aug 26, 2024
@morning4coffe-dev
Copy link
Member Author

After more investigation, actually the correct behavior seems to be that the Flyout shouldn't open at all at that point and the correct item should be selected.

@cconner100
Copy link

So why is the Hamburger icon missing at the top left of the screen? This should open and close the menu but that option is not enabled

@morning4coffe-dev
Copy link
Member Author

Thank you for the clarification, @cconner100. In the video I shared, there is a HotReload indicator that is covering the actual button. You can move it by dragging the two lines. Is that what you were referring to? 🤔

@Youssef1313 Youssef1313 self-assigned this Aug 28, 2024
@cconner100
Copy link

cconner100 commented Aug 29, 2024 via email

@Youssef1313 Youssef1313 added platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform area/navigationview 🧭 Categorizes an issue or PR as relevant to the NavigationView control area/popups 💬 Categorizes an issue or PR as relevant to popups or flyouts labels Aug 29, 2024
@Youssef1313
Copy link
Member

@cconner100 Could you please post a screenshot after moving the HotReload indicator away?

@cconner100
Copy link

cconner100 commented Aug 29, 2024 via email

@Youssef1313 Youssef1313 added project/pointers 🖱️ Categorizes an issue or PR as relevant to mouse/touch/pen pointers and removed area/popups 💬 Categorizes an issue or PR as relevant to popups or flyouts labels Aug 29, 2024
@Youssef1313 Youssef1313 removed their assignment Aug 29, 2024
@Youssef1313
Copy link
Member

The flyout issue is a pointers issue where we get an extra incorrect Tapped event.

	<NavigationView x:Name="NavigationView" PaneDisplayMode="LeftCompact">
		<NavigationView.MenuItems>
			<NavigationViewItem Content="Sub Menu 1" Icon="Keyboard" ToolTipService.ToolTip="Sub Menu 1">
				<NavigationViewItem.MenuItems>
					<NavigationViewItem Content="Notes" Icon="Page" ToolTipService.ToolTip="Notes"/>
				</NavigationViewItem.MenuItems>
			</NavigationViewItem>
		</NavigationView.MenuItems>
		<Frame x:Name="ContentFrame" />
	</NavigationView>

At the following state:

image

Clicking on "Notes" will first cause Tapped event on that NavigationViewItem, which will cause the pane to be closed. Then, we get another incorrect Tapped event on "Sub Menu 1" which will cause it to open as a flyout.

@MartinZikmund
Copy link
Member

The fix for this issue will be merged shortly, we had to confirm it is valid across all targets

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/navigationview 🧭 Categorizes an issue or PR as relevant to the NavigationView control difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working platform/android 🤖 Categorizes an issue or PR as relevant to the Android platform project/pointers 🖱️ Categorizes an issue or PR as relevant to mouse/touch/pen pointers triage/untriaged Indicates an issue requires triaging or verification
Projects
None yet
6 participants