Pluggable Widgets - challenge when used in Modal Pages

0
I guess this is a tricky one: I created a tooltip widget using Pluggable Widget APIs. in ComponentWillMount it tags all DOM classes with a tooltip reference name by an attribute. and in render it uses a React component that uses the attribute to hook onto the target component. It works really well on Atlas TopBar and Atlas Default, it would not render the tooltip when used on a modal page. The library I am using suggests to call a function “reacttooltip.rebuild()” after a modal has opened, however I do not have a clue how I can hook myself into some sort of event once Mendix has opened a Modal page. Anyone willing to help? It’s probably a matter of spending 30 minutes on the source code together… Result would be a really nice tooltip widget with some enhanced features such as supporting multiple languages etc…..for the AppStore    
asked
3 answers
1

Hi Boris,

The issue you are facing with this widget, you are depending on the DOM at time of the activation of the widget. This might cause several issues, as the client can render any part of the HTML DOM at will. This is a property of React.

Test what happen if your tool tip is attached to a part of the page that is hidden and shown again with conditional visibility. 

There is no real solution to this. You could have a look at “observers” but they might kill you client performance.

https://developer.mozilla.org/en-US/docs/Web/API/MutationObserver

About your challenge what “modal” are you referring? Is this a modal page or a dialog?

You can PM me via community Slack is you need some help

Cheers, Andries

 

 

 

 

answered
0

IOP the best tooltip option – https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/title
Compatible with all browsers and no javascript needed.

answered
0

something wierd that sometimes happens with top level widgets, is that if MX is started in a certain layout, if you than switch layouts, it loses context.

you could create a “top level layout” add your widget to that.

Than master layout both the atlas ones to your top level layout.

This might not do anything, but its worth a try :D 

answered