Fomantic-UI icon indicating copy to clipboard operation
Fomantic-UI copied to clipboard

[Popup] Positioning ignores popup classes

Open donaggio opened this issue 8 years ago • 5 comments

Steps

Create an inline popup with positioning classes, ex. "bottom center"

Expected Result

Triggering element opens popup honouring positioning classes

Actual Result

Triggering element opens popup in top center position as if no positioning classes were specified, even if it ends partially off screen

Version

2.6.3, used to work in 2.6.2

Testcase

https://jsfiddle.net/d6w9hcab

donaggio avatar Nov 07 '18 12:11 donaggio

This one was really hard to find out... Seem to be introduced by 05655ef9f0311d64a166ffff44432733cf09d35b.

@lubber-de if you comment this line here, the bug does not appear anymore.

@donaggio if you need a hotfix, please edit the file src/definitions/modules/transition.less, delete the line 51 (.hidden.hidden.transition,) and then rebuild fomantic-ui. Your problem should be solved...

...or wait some days for the next awesome FUI release 😉

prudho avatar Nov 07 '18 14:11 prudho

Thanks @prudho for so quiclky looking into it. I'm not in a hurry, so I'll wait for the next release.

In the meantime, other possible workarounds I've found, which does not involve rebuilding, are:

  • positioning the popup through javascript: $('#trigger').popup({ position: 'bottom center' });

  • positioning through attribute "data-position" in triggering element

Anyway, with my workarounds, while it will actually position the popup in the specified spot, it will not check if the popup will end off screen and, eventually, reposition it.

donaggio avatar Nov 07 '18 14:11 donaggio

:thinking: The main reason for this are the initially set, but IMHO not neccessary classes transition hidden to the popup div. popup divs are hidden by default and if you just remove either transition or hidden everything works as expected. Nevertheless, i saw those classes are also defined in the example docs for popup, so you might had used those examples as codebase. I'll investigate more to provide a better fix, because just removing the css line as suggested will introduce an older bug again.

lubber-de avatar Nov 07 '18 14:11 lubber-de

@donaggio Forget about my last comment. It's the forced display:none in hidden state (even if you remove transitionor hidden, it would happen again the second time you open the popup. I'll take care of it! @prudho Thanks for the hard finding!

lubber-de avatar Nov 07 '18 14:11 lubber-de

Fixed in current Release https://github.com/fomantic/Fomantic-UI/tree/2.6.4

lubber-de avatar Nov 15 '18 12:11 lubber-de