While LaSuli loads fragments for this page, go to a second tab
When LaSuli finished collecting the fragments, it displays them in the current (second, wrong) tab
How to fix
(Warning: unreadable technical stuff).
Injection of the highlighting script is done by the Display component (src/sidebar/jsx/Display.jsx), in order to fulfill the requirement "show highlights whenever the sidebar is open". The private _loadScript() method asks the browser for the current active tab. When the current active tab is not the good one, this bug happens.
Loading the Display component is therefore done by the Sidebar component (src/sidebar/sidebar.jsx), in the getContent() method, called for every this.setState({…}); occurrence.
The one we're interested in is located near the end of the _updateContent() private method, as a callback to the getResource browser call (to the model script).
There is a tab change listener in the componentDidMount() React method. I will dig into it this weekend, but a fix would be to find a non-ugly way to store the tab id in _updateContent() to pass it to Display (why not through the component's state).
Steps to reproduce
How to fix
(Warning: unreadable technical stuff).
Injection of the highlighting script is done by the
Display
component (src/sidebar/jsx/Display.jsx
), in order to fulfill the requirement "show highlights whenever the sidebar is open". The private_loadScript()
method asks the browser for the current active tab. When the current active tab is not the good one, this bug happens.Loading the
Display
component is therefore done by theSidebar
component (src/sidebar/sidebar.jsx
), in thegetContent()
method, called for everythis.setState({…});
occurrence.The one we're interested in is located near the end of the
_updateContent()
private method, as a callback to thegetResource
browser call (to themodel
script).There is a tab change listener in the
componentDidMount()
React method. I will dig into it this weekend, but a fix would be to find a non-ugly way to store the tab id in_updateContent()
to pass it toDisplay
(why not through the component's state).