File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,8 @@ export default class HTMLCodeBlockElement extends HTMLElement {
160160 return ;
161161 }
162162
163+ this . #observer. disconnect ( ) ;
164+
163165 const src = ( ( ) => {
164166 if ( / [ ^ \n ] \n $ / . test ( this . #value) ) {
165167 return `${ this . #value} \n` ;
@@ -207,6 +209,16 @@ export default class HTMLCodeBlockElement extends HTMLElement {
207209 }
208210
209211 set label ( value : any ) {
212+ if (
213+ this . #label === value ||
214+ (
215+ this . #label === '' &&
216+ value === null
217+ )
218+ ) {
219+ return ;
220+ }
221+
210222 if ( value === null ) {
211223 this . #label = '' ;
212224 this . removeAttribute ( 'label' ) ;
@@ -227,6 +239,16 @@ export default class HTMLCodeBlockElement extends HTMLElement {
227239 }
228240
229241 set language ( value : any ) {
242+ if (
243+ this . #language === value ||
244+ (
245+ this . #language === '' &&
246+ value === null
247+ )
248+ ) {
249+ return ;
250+ }
251+
230252 if ( value === null ) {
231253 this . #language = '' ;
232254 this . removeAttribute ( 'language' ) ;
@@ -247,6 +269,10 @@ export default class HTMLCodeBlockElement extends HTMLElement {
247269 }
248270
249271 set controls ( value : boolean ) {
272+ if ( this . #controls === value ) {
273+ return ;
274+ }
275+
250276 this . #controls = value ;
251277
252278 if ( this . #controls) {
You can’t perform that action at this time.
0 commit comments