You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The invenioSearchRangeFactory.js contains a potential infinite loop, fixed with a code that can be improved with a deeper refactoring.
Description:
When the years range facet is modified by the user, the event brush and brushend are fired.
The function implementing the brushend listener is then calling a function updateBrushPosition to redraw the brush.
Unfortunately, this function is dispatching a brush event to complete the redrawing, as stated in the documentation (https://github.com/d3/d3-3.x-api-reference/blob/master/SVG-Controls.md#_brush). This creates an infinite loop.
Workaround
A workaround has been added with this commit: ff63e62
It basically adds checks before firing brush events by comparing the state of the previous user selection to the new one.
Refactoring needed
The code should be refactored by removing as much as possible global states, and should perform redraw actions only when it is really needed.
The text was updated successfully, but these errors were encountered:
The
invenioSearchRangeFactory.js
contains a potential infinite loop, fixed with a code that can be improved with a deeper refactoring.Description:
When the years range facet is modified by the user, the event
brush
andbrushend
are fired.The function implementing the
brushend
listener is then calling a functionupdateBrushPosition
to redraw the brush.Unfortunately, this function is dispatching a brush event to complete the redrawing, as stated in the documentation (https://github.com/d3/d3-3.x-api-reference/blob/master/SVG-Controls.md#_brush). This creates an infinite loop.
Workaround
A workaround has been added with this commit: ff63e62
It basically adds checks before firing brush events by comparing the state of the previous user selection to the new one.
Refactoring needed
The code should be refactored by removing as much as possible global states, and should perform redraw actions only when it is really needed.
The text was updated successfully, but these errors were encountered: