TabView only supports closing tabs with a pointer device
See original GitHub issueDescribe the bug
It is not possible to close a TabViewItem
using just the keyboard - likely ALLY issue.
Steps to reproduce the bug
- In a blank app, add a
TabView
control. - Add some
TabViewItem
s to theTabItems
collection. - Add a handler for the
TabCloseRequested
event. - Set a break point in the event handler.
<winui:TabView
TabCloseRequested="OnTabCloseRequested">
<winui:TabView.TabItems>
<winui:TabViewItem Header="Item 1" />
<winui:TabViewItem Header="Item 2" />
<winui:TabViewItem Header="Item 3" />
</winui:TabView.TabItems>
</winui:TabView>
- Run the app.
- Try and close a tab without using a mouse, pen, finger, or other pointing device. i.e. just using keyboard (or a connected controller.)
Expected behavior The break point will never be hit! It should be possible to close a tab without having to use a pointing device. Without this it is not possible to provide a fully accessible experience using this control.
Screenshots
button in question is highlighted in the screenshot below
Version Info
NuGet package version: Microsoft.UI.Xaml 2.2.190917002
Windows 10 version | Saw the problem? |
---|---|
Insider Build (xxxxx) | |
May 2019 Update (18362) | Yes |
October 2018 Update (17763) | |
April 2018 Update (17134) | |
Fall Creators Update (16299) | |
Creators Update (15063) |
Device form factor | Saw the problem? |
---|---|
Desktop | Yes> |
Mobile | |
Xbox | |
Surface Hub | |
IoT |
Additional context This issue was discovered as part of investigation into https://github.com/microsoft/WindowsTemplateStudio/issues/3407
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:9 (8 by maintainers)
Top Results From Across the Web
TabView Class - Windows App SDK
Tab controls are useful for displaying several pages (or documents) of content while giving a user the capability to rearrange, open, or close...
Read more >NSTabViewController | Apple Developer Documentation
A container view controller that manages a tab view interface, which organizes multiple pages of content but displays only one page at a...
Read more >Swiftui: How to Close one Tab in a TabView?
However, I don't know how to close only one Tab Element. I've tried to use dismiss() and dynamically changing vm.images element. Latter one ......
Read more >Tabview (lv_tabview)
New tabs can be added with lv_tabview_add_tab(tabview, "Tab name") . It will return with a pointer to a Page object where the tab's...
Read more >Disable new iOS 15's transparent TabView : r/SwiftUI
Since iOS 15, the tab bar will have a transparent background when there is a scrollview and that scrollview is scrolled to the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Yes, I was middle-clicking with the mousewheel but it did not realize the cursor has to be over the tab and this doesn’t work if the cursor is over the tab’s content.
A default content item would be a good solution. Also having the Ctrl+F4 shortcut documented somewhere a user might possibly find it would also be good. I expect to see it as a tool-tip on on the close button.
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days.