Semantic-UI-React icon indicating copy to clipboard operation
Semantic-UI-React copied to clipboard

IE11 long modal scrolling

Open sergez opened this issue 9 years ago • 12 comments

dimmed isn't assigned/added to body when opening long modal in IE11

Steps

  • Open long modal in IE11

Expected Result

The modal should be scrollable

Actual Result

The modal isn't scrollable

Version

0.68.5

Testcase

Open in IE11 https://codepen.io/anon/pen/gRrPRo

sergez avatar Jun 10 '17 20:06 sergez

duplicate? https://github.com/Semantic-Org/Semantic-UI-React/issues/1157

marcdibold avatar Jun 12 '17 07:06 marcdibold

Yep, it's dupe of #1157.

layershifter avatar Jun 12 '17 07:06 layershifter

I'm not sure. Because it's reproduced with one modal and only on IE11

sergez avatar Jun 12 '17 07:06 sergez

c'mon guys. It not duplicate. However #1157 reproduced in every browser and this bug reproduced only in IE11. Have you tried to open ONLY ONE long modal in Chrome and in IE11 ?

sergez avatar Jun 12 '17 07:06 sergez

I used link to codepen from #1157 to keep it alive. It might confuse you...

sergez avatar Jun 12 '17 07:06 sergez

Ok

layershifter avatar Jun 12 '17 08:06 layershifter

@sergez You're right, thanks for clarification. I've checked in IE and there is really something wrong.

Chrome

_885

IE

_886

layershifter avatar Jun 12 '17 08:06 layershifter

We can leave this open for investigation, but highly likely that this is a CSS issue which should be fixed over at https://github.com/Semantic-Org/Semantic-UI.

levithomason avatar Jun 15 '17 03:06 levithomason

The problem is probably that IE11 does not support multiple parameters in classList.add(), so the 'dimmed' class is not being added to the body element.

See handlePortalMount() in Modal.js

handlePortalMount = (e) => {
    debug('handlePortalMount()')
    const { dimmer } = this.props
    const mountNode = this.getMountNode()

    if (dimmer) {
      debug('adding dimmer')
      
      // FIXME - needs workaround to work in IE 11?
      mountNode.classList.add('dimmable', 'dimmed')

      if (dimmer === 'blurring') {
        debug('adding blurred dimmer')
        mountNode.classList.add('blurring')
      }
    }

    this.setPosition()

    const { onMount } = this.props
    if (onMount) onMount(e, this.props)
  }

zlove avatar Jul 13 '17 05:07 zlove

Using a classList polyfill (https://github.com/yola/classlist-polyfill) resolved this issue for me.

zlove avatar Jul 13 '17 07:07 zlove

@zlove thanks for the investigation :+1: PR is coming

layershifter avatar Jul 13 '17 09:07 layershifter

Happy to help @layershifter. Thanks for the quick fix!

zlove avatar Jul 13 '17 17:07 zlove