fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

Fabric Modal is invisible on Mobile

Open devinprejean opened this issue 8 years ago • 7 comments

Bug Report

  • Package version(s): (fill this out)
  • Browser and OS versions: (fill this out if relevant)

Priorities and help requested:

Are you willing to submit a PR to fix? No

Requested priority: High

Products/sites affected: (if applicable)

Describe the issue:

The modal component shows just fine on all desktop browsers but when I check Safari, Chrome, and SharePoint app on IOS it is invisible. I have to click around until i find the "dismiss" button

Actual behavior:

Modal is invisible. I can scroll the content but can't click any of it until i find the invisible dismiss button

Expected behavior:

The modal should be visible.

If applicable, please provide a codepen repro:

     `<Modal
        isOpen={modalVisible}
        onDismiss={this.hideModal}
        isBlocking={true}
        className={styles.modalContainer}
        isDarkOverlay={true}
      >
        <div>{agreementText}</div>
        <DefaultButton
          description="Closes Modal Window"
          onClick={this.hideModal}
          text={buttonText}
        />
      </Modal>`

for simplicity sake i removed ALL css specific to the modal and still nothing is showing.

devinprejean avatar Jul 25 '18 19:07 devinprejean

If I visit the fabric testing page on my phone https://developer.microsoft.com/en-us/fabric#/components/modal then they show up. I assume something is going on with SharePoint? I copied the code from the fabric page and used that same code, still not visible.

devinprejean avatar Jul 26 '18 14:07 devinprejean

Hey @devinprejean , can you clarify what environment(s) you're seeing this in and if possible which version(s) of Fabric it's associated with? Is it a publishing page in SharePoint? I also don't repro the issue on the Fabric site in Safari iOS. We can try to repro in SP if you can share a little more detail. Thanks!

Jahnp avatar Jul 26 '18 16:07 Jahnp

Certainly. I'm in SPO communication site on Safari IOS and the IOS SharePoint app. I'm using Fabric react version ^5.67.0

devinprejean avatar Jul 26 '18 17:07 devinprejean

Hello @devinprejean I have encountered the same issue. I used a quick workaround: private fixModal() { $('body > .ms-Layer.ms-Layer--fixed > .ms-Fabric.ms-Layer-content > div').removeAttr('style'); } I made a new component with this function firing in componentDidUpdate() Hope it will help you. At least for now :)

Konradox avatar Jul 31 '18 11:07 Konradox

Thanks @konradox for the workaround but it looks like you’re using jQuery. For us that is not an option.

devinprejean avatar Jul 31 '18 16:07 devinprejean

Of course, you can use pure JS in your case. I had a jQuery added to a project so I used it because it is cleaner. The goal is pretty clear. You have to remove inline styles to show this modal.

Here, take a working sample: document.getElementsByTagName('body')[0].getElementsByClassName('ms-Layer ms-Layer--fixed')[0].getElementsByClassName('ms-Fabric ms-Layer-content')[0].getElementsByTagName('div')[0].style.cssText = ''

Konradox avatar Jul 31 '18 16:07 Konradox

I'm going to close this issue as we weren't able to repro it outside of SharePoint. If this is a widespread problem and there's something that needs to be changed in Fabric to avoid this issue, please let us know.

mikewheaton avatar Oct 18 '18 21:10 mikewheaton