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.

displayed promise should probably trigger on after-show if widget is initially invisible

See original GitHub issue

Right now, the Javascript side of a widget has a displayed promise that triggers on after-attach. However, some libraries actually need to know when they are visible on the page, not just attached (for example, initially sizing things in bqplot needs to measure its size after the browser has laid out things). This comes up if your widget is in a non-active tab in the stock Tab widget, for example, where the after-attach event triggers because you are added to the DOM, but you are not visible until later, when the user clicks on the tab (and then your widget gets a Lumino after-show event).

Should we: A. change the semantics of the displayed promise to only trigger on after-attach if the widget is visible, and trigger on the first after-show otherwise? B. Leave displayed to be tied to after-attach and push the logic down to the widget author. If you really need to wait until you have visibility, set up their own promise that waits for an after-show event after the displayed event? Or if you are already setting up Lumino event processing in your custom widget, perhaps you should tie into the Lumino after-attach event instead of the ipywidgets displayed promise?

I think A probably makes sense? Are there widgets that will want to do some processing after attachment even if they are invisible?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
jasongroutcommented, Feb 11, 2020

On the other hand, we could just encourage people to process the Lumino after-attach and after-show Lumino events, and ignore the displayed promise.

0reactions
vidartfcommented, Nov 2, 2021

This was mainly closed by #3300 together with the discussion in this issue. Note also the planned changes in #2605.

Read more comments on GitHub >

github_iconTop Results From Across the Web

jQuery event to trigger action when a div is made visible
Is it possible to attach some sort of "isvisible" event handler to arbitrary divs and have certain code run when they the div...
Read more >
Ext.grid.column.Widget | Ext JS 6.5.1 - Sencha Documentation
A string component id or the numeric index of the component that should be initially activated within the container's layout on render.
Read more >
ui.popup, API Reference Webix Docs - Documentation
blockEvent, temporarily blocks triggering of ALL events of the calling object ... hidden, defines whether the view will be hidden initially.
Read more >
Ext.grid.column.Widget | Ext JS 6.2.0 - Index of /
By default the shadow is hidden while the component is animating ... An array of events that, when fired, should trigger this object...
Read more >
Add actions to widgets—ArcGIS Experience Builder
Action in one widget can trigger action in another widget. ... that the data displayed by widgets can change universally when the underlying...
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