Files
flipper/src/ui/components
Benjamin Elo ecf2831d5d Added toggle fix for dropdown device menu
Summary:
Summary of Bug:

The devices menu popup does not toggle as expected.

Because of the way the click event is fired in Javascript, that is mousedown, mouseup, click, and the fact that the electron menu closes on mousedown, was why the menu was not toggling as expected.

Fix:

This is a potential fix where I add some state to tell if the menu was recently closed, and disable the popup if it was. This is done through the callback method of menu.popup. Then on the next mouse event I renable the popup.

In addition to this, I moved the popup logic into onMouseUp instead of onClick. This was simply to make the code neater. Before I would have to add a timer to the onMouseUp event that would fire after the click event and renable the popup.

Let me know if there is a simple solution to this problem that I've completely missed.

Reviewed By: jknoxville

Differential Revision: D16028864

fbshipit-source-id: a73202536762cce2ab623176cbda0369ca2b8079
2019-06-27 07:19:43 -07:00
..
2018-12-14 10:35:12 -08:00
2019-06-10 10:36:25 -07:00
2018-10-22 09:54:59 -07:00
2019-06-19 09:01:00 -07:00
2018-08-23 09:42:18 -07:00
2018-08-23 09:42:18 -07:00
2018-11-05 03:12:23 -08:00
2018-11-05 03:12:23 -08:00
2018-08-23 09:42:18 -07:00
2019-05-10 05:53:43 -07:00
2018-10-22 09:54:59 -07:00
2019-06-10 10:36:25 -07:00
2019-06-10 10:36:25 -07:00
2018-08-23 09:42:18 -07:00
2018-11-05 03:12:23 -08:00
2018-11-05 03:12:23 -08:00
2018-11-05 03:12:23 -08:00
2018-11-05 03:12:23 -08:00
2018-11-05 03:12:23 -08:00
2018-08-23 09:42:18 -07:00
2018-12-18 08:37:28 -08:00
2018-11-05 03:12:23 -08:00
2018-08-23 09:42:18 -07:00
2018-08-23 09:42:18 -07:00
2018-08-23 09:42:18 -07:00
2018-08-23 09:42:18 -07:00
2018-08-23 09:42:18 -07:00
2018-08-23 09:42:18 -07:00
2018-08-23 09:42:18 -07:00
2019-06-20 03:51:17 -07:00
2018-06-01 11:03:58 +01:00
2018-11-05 03:12:23 -08:00
2019-01-09 10:48:18 -08:00
2018-08-23 09:42:18 -07:00
2018-08-23 09:42:18 -07:00
2018-12-14 10:35:12 -08:00
2018-11-05 03:12:23 -08:00
2018-10-22 09:54:59 -07:00
2018-08-23 09:42:18 -07:00
2018-08-23 09:42:18 -07:00
2018-08-23 09:42:18 -07:00
2018-08-23 09:42:18 -07:00
2018-11-05 03:12:23 -08:00
2018-08-23 09:42:18 -07:00
2018-10-22 09:54:59 -07:00
2018-06-01 11:03:58 +01:00
2018-10-22 09:54:59 -07:00