@@ -299,6 +299,12 @@ export class ActionItemBase extends ViewBase implements ActionItemDefinition {
299299 this . actionView = value ;
300300 }
301301
302+ public _onVisibilityChanged ( visibility : string ) {
303+ if ( this . actionBar ) {
304+ this . actionBar . update ( ) ;
305+ }
306+ }
307+
302308 public eachChild ( callback : ( child : ViewBase ) => boolean ) {
303309 if ( this . _actionView ) {
304310 callback ( this . _actionView ) ;
@@ -323,13 +329,17 @@ function onItemChanged(item: ActionItemBase, oldValue: string, newValue: string)
323329 }
324330}
325331
332+ function onVisibilityChanged ( item : ActionItemBase , oldValue : string , newValue : string ) {
333+ item . _onVisibilityChanged ( newValue ) ;
334+ }
335+
326336export const textProperty = new Property < ActionItemBase , string > ( { name : "text" , defaultValue : "" , valueChanged : onItemChanged } ) ;
327337textProperty . register ( ActionItemBase ) ;
328338
329339export const iconProperty = new Property < ActionItemBase , string > ( { name : "icon" , valueChanged : onItemChanged } ) ;
330340iconProperty . register ( ActionItemBase ) ;
331341
332- export const visibilityProperty = new Property ( { name : "visibility" , defaultValue : "visible" , valueChanged : onItemChanged } ) ;
342+ export const visibilityProperty = new Property ( { name : "visibility" , defaultValue : "visible" , valueChanged : onVisibilityChanged } ) ;
333343visibilityProperty . register ( ActionItemBase ) ;
334344
335345export const flatProperty = new Property < ActionBarBase , boolean > ( { name : "flat" , defaultValue : false , valueConverter : booleanConverter } ) ;
0 commit comments