fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

CommandBar button not visible from mobile in SPFx web part.

Open kmosti opened this issue 9 years ago • 14 comments

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 avatar Nov 13 '17 07:11 kmosti

@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).

patrickabel avatar Dec 21 '17 21:12 patrickabel

Yes, a display: none style is applied once the window width is less than 640px.

kmosti avatar Jan 19 '18 08:01 kmosti

@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.

patrickabel avatar Jan 24 '18 14:01 patrickabel

Has anyone made any progress with this or found a work around?

nhadro avatar Feb 06 '18 20:02 nhadro

Unfortunately no, still an issue.

patrickabel avatar Feb 06 '18 21:02 patrickabel

Hi. I am able to see those buttons with smaller window sizes, but still not working in mobile(which is, btw, 720x1280px)

artxach avatar Feb 18 '18 10:02 artxach

Has anyone made any progress on this issue?

mayurkumbhare avatar Mar 23 '18 07:03 mayurkumbhare

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 avatar Apr 26 '18 13:04 kmosti

@kmosti do you have a sample of this working?

patrickabel avatar Apr 26 '18 14:04 patrickabel

@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.

kmosti avatar Apr 27 '18 12:04 kmosti

Does anyone has a sample for collapsing navigation when width is less than 640px

harshdamaniahd avatar May 26 '18 03:05 harshdamaniahd

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?

stale[bot] avatar Jul 25 '18 04:07 stale[bot]

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?

stale[bot] avatar Aug 08 '18 04:08 stale[bot]

No fix yet?

purvishce avatar Apr 24 '19 22:04 purvishce