question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RFC: Popup more intuitive behavior with multiple `on` events

See original GitHub issue

Bug Report

The problem happens when using multiple events to trigger Popup. Can be reproduced with <Popup trigger={<button>Show tooltip</button>} content='tooltip' on={['click', 'hover']} but the easiest way is with <Popup trigger={<button>Show tooltip</button>} content='tooltip' on={['click', 'focus']}. Just try clicking the button. For the first time, it opens the popup and immediately closes it. Following clicks work correctly. This problem has been mentioned in #2075 by @austinfox here.

Steps

  1. Go to Semantic UI React Popup demo.
  2. Edit e.g. first example Popup component to contain multiple on events i.e. on={['click', 'focus']}.
  3. Click the popup trigger.

Expected Result

Popup is displayed and stays open.

Actual Result

Popup is displayed and closed immediately.

Version

0.80.0

Testcase

Check the steps section above.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
levithomasoncommented, May 6, 2018

I’m not sure this is a bug necessarily. The order of events in the browser when clicking a button is click then focus. What is happing is technically correct, though not helpful. The first event, click, opens the popup while the immediate second event, focus, closes it again.

The on prop toggles the popup on the given events. There are a few ways this could be reworked to give more intuitive results.

openOn / closeOn

Splitting or adding these props would allow you to specify which events should open and close the popup. You’d apply focus to the openOn and click to both openOn and closeOn. This way, focus only opens the popup.

Special focus/blur handling

This might be the more desirable solution. Focus could strictly open the popup and blur could strictly close it. This is not technically the correct behavior given the prop config of “toggle on focus”, however, it does give a more intuitive behavior. I would think most users would expect focus to open the popup.

I’d like to hear thoughts and feedback on these and any other solutions folks may have.

0reactions
stale[bot]commented, Aug 4, 2019

This issue will be closed due to lack of activity for 12 months. If you’d like this to be reopened, just leave a comment; we do monitor them!

Read more comments on GitHub >

github_iconTop Results From Across the Web

DST transitions vs. iCalendar reminders vs. RFC 5545 ...
"how do most calendar apps deal with this unintuitive behavior? Do they ignore the spec and always treat reminders <24 hours as exact ......
Read more >
RFC 3265 - Session Initiation Protocol (SIP) - IETF Datatracker
RFC 3265 SIP-Specific Event Notification June 2002 be thought of as an abstract base class which must be derived into an instantiatable class...
Read more >
RFC 2458: Toward the PSTN/Internet Inter-Networking
It addresses technologies, architectures, and several (but by no means all) ... First, the basic terminology and a short "intuitive" description of the...
Read more >
Multiple Actions on Configure Events - Ignition Early Access
I have a popup with a button. When I click (in Browser) or touch (in mobile app) I want the button to set...
Read more >
What's New - Tines
You can use the Live events in the builder for auto-complete and inspecting the data. You can view Live events in the event...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found