Commit d4f92459 authored by Eduardo Sanz García's avatar Eduardo Sanz García Committed by Eduardo

ResizeObserver is now defined in the latest TS version

Removed @ts-ignore
parent c7778a94
......@@ -172,12 +172,9 @@ export default class PDF extends Delegator {
// nb. In browsers that don't support `ResizeObserver` the banner height
// will simply be static and not adjust if the window is resized.
//
// @ts-expect-error - TS is missing `ResizeObserver`
if (typeof ResizeObserver !== 'undefined') {
// Update the banner when the window is resized or the Hypothesis
// sidebar is opened.
// @ts-ignore
new ResizeObserver(updateBannerHeight).observe(this._warningBanner);
}
updateBannerHeight();
......
......@@ -12,9 +12,7 @@
* @return {() => void}
*/
export default function observeElementSize(element, onSizeChanged) {
// @ts-ignore - TS is missing `ResizeObserver` type definition
if (typeof ResizeObserver !== 'undefined') {
// @ts-ignore
const observer = new ResizeObserver(() =>
onSizeChanged(element.clientWidth, element.clientHeight)
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment