lichess-org / chessground

Mobile/Web chess UI for lichess.org
https://lichess.org
GNU General Public License v3.0
1.03k stars 262 forks source link

implement resize observer (closes #137) #139

Closed niklasf closed 4 years ago

niklasf commented 4 years ago

More robustness for bounds changes. Presumably fixes glitches like https://github.com/ornicar/lila/issues/5126.

Uses a new routine for updating bounds instead of triggering a full redraw, because the resize observer would trigger when the board element is replaced during redraw.

Unfortunately still requires the chessground.resize crutch for Edge < 79 and Safari < 13.1 (https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver#Browser_compatibility).