This repository was archived by the owner on Oct 8, 2020. It is now read-only.
File tree 2 files changed +8
-4
lines changed
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -130,10 +130,10 @@ export class CustomHeader {
130
130
header [ button ] . querySelector ( 'mwc-icon-button' ) . style . display = 'none' ;
131
131
}
132
132
header [ button ] . querySelector ( 'ha-icon, ha-icon-button, paper-icon-button' ) . style . height = '48px' ;
133
- const items = Array . from ( header [ button ] . querySelectorAll ( 'paper-item' ) ) ;
133
+ const items = Array . from ( header [ button ] . querySelectorAll ( 'mwc-list-item, paper-item' ) ) ;
134
134
items . forEach ( item => {
135
135
const index = items . indexOf ( item ) ;
136
- this . tapOrClick ( item , this . ha_elem [ button ] . querySelectorAll ( 'paper-item' ) [ index ] ) ;
136
+ this . tapOrClick ( item , this . ha_elem [ button ] . querySelectorAll ( 'mwc-list-item, paper-item' ) [ index ] ) ;
137
137
} ) ;
138
138
} else {
139
139
if ( ! this . ha_elem [ button ] ) return ;
@@ -168,7 +168,11 @@ export class CustomHeader {
168
168
tapOrClick ( listenElement , clickElement ) {
169
169
listenElement . setAttribute ( 'onClick' , ' ' ) ;
170
170
listenElement . addEventListener ( 'click' , ( ) => {
171
- clickElement . dispatchEvent ( new MouseEvent ( 'click' , { bubbles : false , cancelable : false } ) ) ;
171
+ if ( clickElement . nodeName === 'MWC-LIST-ITEM' ) {
172
+ clickElement . click ( ) ;
173
+ } else {
174
+ clickElement . dispatchEvent ( new MouseEvent ( 'click' , { bubbles : false , cancelable : false } ) ) ;
175
+ }
172
176
} ) ;
173
177
}
174
178
}
Original file line number Diff line number Diff line change @@ -116,7 +116,7 @@ export class CustomHeaderConfig {
116
116
if ( config . show_tabs ) config . show_tabs = processTabArray ( config . show_tabs ) ;
117
117
if ( config . show_tabs && config . show_tabs . length ) config . hide_tabs = invertNumArray ( config . show_tabs ) ;
118
118
if ( config . disable_sidebar || config . menu_dropdown ) config . menu_hide = true ;
119
- if ( config . voice_dropdown ) config . voice_hide = true ;
119
+ if ( config . voice_dropdown || ! haElem . hass . config . components . includes ( 'conversation' ) ) config . voice_hide = true ;
120
120
if ( config . header_text != undefined && config . header_text == '' ) {
121
121
config . header_text = this . default_config . header_text ;
122
122
}
You can’t perform that action at this time.
0 commit comments