PluginProbe
Gutenberg / 24.1.0
Gutenberg v24.1.0
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
← All changes | build/modules/block-editor/utils/fit-text-frontend.js +5 -1 23.2.1 → 24.1.0 View file →
@@ -59,8 +59,11 @@
59 59 init() {
60 60 const context = getContext();
61 61 const { ref } = getElement();
62 62 const applyFontSize = (fontSize) => {
63 + if (!ref) {
64 + return;
65 + }
63 66 if (fontSize === 0) {
64 67 ref.style.fontSize = "";
65 68 } else {
66 69 ref.style.fontSize = `${fontSize}px`;
@@ -66,9 +69,9 @@
66 69 ref.style.fontSize = `${fontSize}px`;
67 70 }
68 71 };
69 72 context.fontSize = optimizeFitText(ref, applyFontSize);
70 - if (window.ResizeObserver && ref.parentElement) {
73 + if (window.ResizeObserver && ref?.parentElement) {
71 74 const resizeObserver = new window.ResizeObserver(() => {
72 75 context.fontSize = optimizeFitText(ref, applyFontSize);
73 76 });
74 77 resizeObserver.observe(ref.parentElement);
@@ -78,8 +81,9 @@
78 81 resizeObserver.disconnect();
79 82 }
80 83 };
81 84 }
85 + return void 0;
82 86 }
83 87 }
84 88 });
85 89 //# sourceMappingURL=fit-text-frontend.js.map