File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -165,7 +165,8 @@ const displayDialogue = async(editor) => {
165165 if ( soleCategories . length > 0 || selectCategories . length > 0 ) {
166166 const savedCategory = currentCategoryId ;
167167 const savedFlavor = lastFlavor [ currentCategoryId ] ;
168- if ( soleCategories . length == 0 || soleCategories [ 0 ] . displayorder > selectCategories [ 0 ] . displayorder ) {
168+ if ( ( selectCategories . length > 0 )
169+ && ( soleCategories . length == 0 || soleCategories [ 0 ] . displayorder > selectCategories [ 0 ] . displayorder ) ) {
169170 selectCategories [ 0 ] . click ( ) ;
170171 } else {
171172 soleCategories [ 0 ] . click ( ) ;
@@ -236,6 +237,11 @@ const handleCategoryFlavorClick = (event, modal) => {
236237
237238 const componentButtons = modal . getRoot ( ) [ 0 ] . querySelectorAll ( '.elements-buttons-preview button' ) ;
238239 componentButtons . forEach ( componentButton => {
240+ // Remove previous flavor.
241+ if ( componentButton . dataset . flavor != undefined ) {
242+ componentButton . classList . remove ( componentButton . dataset . flavor ) ;
243+ }
244+ componentButton . classList . add ( currentFlavor ) ;
239245 componentButton . dataset . flavor = currentFlavor ;
240246 if (
241247 ( componentButton . dataset . flavorlist == '' || componentButton . dataset . flavorlist . split ( ',' ) . includes ( currentFlavor ) ) &&
You can’t perform that action at this time.
0 commit comments