File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,10 @@ class GEmojiElement extends HTMLElement {
3535 image . src = this . getAttribute ( 'fallback-src' ) || ''
3636 this . appendChild ( image )
3737 }
38- updateTone ( this )
38+
39+ if ( this . hasAttribute ( 'tone' ) ) {
40+ updateTone ( this )
41+ }
3942 }
4043
4144 static get observedAttributes ( ) : Array < string > {
Original file line number Diff line number Diff line change @@ -29,6 +29,14 @@ describe('g-emoji', function() {
2929 assert . equal ( 'G-EMOJI' , el . nodeName )
3030 assert . equal ( '👋🏻' , el . textContent )
3131 } )
32+
33+ it ( 'does not change skin tone when connected without tone attribute' , function ( ) {
34+ const el = new window . GEmojiElement ( )
35+ el . textContent = '👋🏻'
36+ document . body . append ( el )
37+ assert . equal ( 'G-EMOJI' , el . nodeName )
38+ assert . equal ( '👋🏻' , el . textContent )
39+ } )
3240 } )
3341
3442 describe ( 'in emoji-supporting platforms' , function ( ) {
You can’t perform that action at this time.
0 commit comments