Skip to content

Issue 7472 - Re-set CSS --width on window resize

Andrea Giammarchi requested to merge issue-417 into release-2018-5

As mentioned in https://gitlab.com/eyeo/adblockplus/abpui/adblockplusui/issues/417, it is actually relatively trivial to re-set the CSS width of the component.

In this implementation:

  • the component uses the this.refs feature from HyperHTMLElement to simplify the querying of the same button N times
  • the only problematic part, which is the component width, has been refactored a part
  • the resize event is debounced at 30 FPS and the layout restored after double rAF, since it's apparently the most reliable way to do so

Merge request reports