Semantic-ui: [Popup] `hideOnScroll` doesn鈥檛 work with `on: manual`

Created on 15 Mar 2017  路  11Comments  路  Source: Semantic-Org/Semantic-UI

There seems to be problems when using popup with on property set to manual. It does not hide on scroll even if it is set to true, with/without scrollContext set. It does not hide on outside click even when closable property is set. And when I specify hoverable it rather hides the popup after it is hovered and then re position cursor somewhere else.
It feels completely broken with manual show/hide option or am I missing something here?

Confirmed Bug stale

Most helpful comment

@Prabhakar-Poudel If you don鈥檛 want your popups be destroyed, use pre-existing HTML, or set preserve to true.

I assume how popup appears hover/click/focus/manual should have nothing to do with what the behavior of popup is. Both are independent elements and should have their own properties.

'manual' setting implies that a developer controls when and how to show or hide a popup, and a 'manual' popup will never close until a developer tells it to, rendering hoverable: true useless.

All 11 comments

Dear @Prabhakar-Poudel, As per our Contribution Guide, kindly provide with a test case so that we may further analyse if it's a genuine issue or a bug.

You can fork this jsFiddle and post it here :)

Check this fiddle
Points to observe:

  1. Hover over popup and move cursor away from it - the popup vanishes
  2. Scroll around - popup remains
  3. Click outside popup - popup remains

All these are just opposite to what should happen.

It does try to hide it, but then it always falls here; the culprit is isInDOM variable.

@Banandrew How about the scroll and hover problems?

@Prabhakar-Poudel That鈥檚 about the scrolling, closable property works only with on: 'click', and it only makes sense to use hoverable when it鈥檚 on: 'hover'.

Lets say I have a table, with 100 cells, I want to show a popup to take some input when clicked on cells. I thought making on: click would do the click and I would reuse the same popup for all cells.
But, when I navigate through the table the popup gets destroyed. So, I had to fallback to manual approach.

@Banandrew

it only makes sense to use hoverable when it鈥檚 on: 'hover'.

I assume how popup appears hover/click/focus/manual should have nothing to do with what the behavior of popup is. Both are independent elements and should have their own properties.

@Prabhakar-Poudel If you don鈥檛 want your popups be destroyed, use pre-existing HTML, or set preserve to true.

I assume how popup appears hover/click/focus/manual should have nothing to do with what the behavior of popup is. Both are independent elements and should have their own properties.

'manual' setting implies that a developer controls when and how to show or hide a popup, and a 'manual' popup will never close until a developer tells it to, rendering hoverable: true useless.

'manual' setting implies that a developer controls when and how to show or hide a popup, and a 'manual' popup will never close until a developer tells it to, rendering hoverable: true useless

It would be nice to have a on : manual popup with an option that allows it to automatically fade/transition after some delay. Otherwise it remains open indefinitely.


onShow() {

        $(document).on('click', function(e) {
          if ($(e.target).closest($('.my-popup')).length === 0) {
            $(element.currentTarget).popup('hide');
          }
        });
        $(document).on('keydown', function(e) {
          const escKeyCode = 27;
          if (e.keyCode === escKeyCode) {
            $(element.currentTarget).popup('hide');
          }
        });
      },

I had to do all those bakwas to get the same thing done.
Originally posted in stack overflow.

On similar lines you could hookup a timeout function inside onShow() that closes the popup.

You can call
```javascript
$('.some.selector').popup('bind close on scroll');
````

to bind the events

See code here
https://github.com/Semantic-Org/Semantic-UI/blob/master/src/definitions/modules/popup.js#L997

There has been no activity in this thread for 90 days. While we care about every issue and we鈥檇 love to see this fixed, the core team鈥檚 time is limited so we have to focus our attention on the issues that are most pressing. Therefore, we will likely not be able to get to this one.

However, PRs for this issue will of course be accepted and welcome!

If there is no more activity in the next 90 days, this issue will be closed automatically for housekeeping. To prevent this, simply leave a reply here. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

playgithub picture playgithub  路  3Comments

rdzidziguri picture rdzidziguri  路  3Comments

mllamazares picture mllamazares  路  3Comments

vinhtq picture vinhtq  路  3Comments

larsbo picture larsbo  路  3Comments