CommandBar button not visible from mobile in SPFx web part.
Bug Report
- Package version(s): could not find version number, but it is the one included in the most recent version of spfx yeoman template (yo @microsoft/sharepoint)
Priorities and help requested (not applicable if asking question):
Are you willing to submit a PR to fix? Yes
Requested priority: Normal
Products/sites affected: SharePoint client side web parts.
Describe the issue:
CommandBar button is not visible in mobile view:
From a desktop or iPad, everything works as expected: Desktop view
However, from a mobile view (here pictured iPhone 6 emulated from Chrome, but I see the same issue from any mobile device): Mobile view
Actual behavior:
The button is hidden from mobile devices
Expected behavior:
The button should be visible
If applicable, please provide a codepen repro:
It is an SPFX web part, I would be happy to share the whole thing if needed, but the relevant section is:
import { Spinner, SpinnerSize, MessageBar, MessageBarType, Dialog, DialogType, Button, Label, Panel, PanelType, TextField, CommandBar, CommandBarButton,ICommandBarProps } from 'office-ui-fabric-react';
const commandBarItems: ICommandBarProps = {
items: [{
key: "nyttAvvik",
name: "Nytt avvik",
iconProps: {
iconName: "PowerApps2Logo"
},
href: "https://web.powerapps.com/webplayer/app?web=1&projectnr=" + this.state.projectNumber + "&appId=%2fproviders%2fMicrosoft.PowerApps%2fapps%2f60ed12b1-b05e-4b1d-8d33-42e50bbfeacf"
}]
};
<CommandBar
isSearchBoxVisible={ false }
items={commandBarItems.items}
/>
@kmosti are you seeing this behavior for desktop when your browser is made very small width-wise as well?
I've got a similar issue trying to re-use a SPFx Extension based global navigation solution and I'm noticing that the CommandBar disappears at a certain breaking point (whereas I would expect the default behavior be to hide the menu underneath an ellipsis).
Yes, a display: none style is applied once the window width is less than 640px.
@kmosti what would be your recommendation be for bringing mobile support to the CommandBar component? I'll like for my navigation links to collapse under an icon or ellipsis like the overflow items.
Has anyone made any progress with this or found a work around?
Unfortunately no, still an issue.
Hi. I am able to see those buttons with smaller window sizes, but still not working in mobile(which is, btw, 720x1280px)
Has anyone made any progress on this issue?
No progress here? @patrickabel I think the best course of action is to collapse navbar items beneath an ellipsis, but if you only have one item on the bar (eg "add new") I don't think you need any change from desktop->mobile.
@kmosti do you have a sample of this working?
@patrickabel Do you mean a proposed fix? No I don't. The code sample in my OP is the one I am using but I have not attempted a fix.
Does anyone has a sample for collapsing navigation when width is less than 640px
This issue has been automatically marked as stale because it has not activity for 60 days. It will be closed if no further activity occurs within 14 days of this comment. Thank you for your contributions to Fabric React! Why am I receiving this notification?
This issue has been automatically closed because it has not had recent activity after being marked as stale. If you belive this issue is still a problem or should be reopened, please reopen it! Thank you for your contributions to Fabric React! Why am I receiving this notification?
No fix yet?