This repository was archived by the owner on May 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Expand file tree Collapse file tree 4 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 8888 </ span >
8989 </ span >
9090 < menu-item-affix-list
91- *ngIf ="item.itemSuffixes.isNotEmpty "
91+ *ngIf ="item.hasVisibleSuffixes "
9292 class ="suffix-list "
9393 [disabled] ="!item.enabled "
9494 [items] ="item.itemSuffixes ">
Original file line number Diff line number Diff line change @@ -77,4 +77,7 @@ class DelegatingMenuItem<SubMenuType> implements MenuItem<SubMenuType> {
7777
7878 @override
7979 String get secondaryLabel => _delegate.secondaryLabel;
80+
81+ @override
82+ bool get hasVisibleSuffixes => _delegate.hasVisibleSuffixes;
8083}
Original file line number Diff line number Diff line change @@ -203,6 +203,12 @@ class MenuItem<T> with MenuItemMixin implements HasUIDisplayName, HasIcon {
203203 'Only one of itemSuffix or itemSuffixes should be provided' );
204204 }
205205
206+ /// True if any of the [itemSuffixes] are rendered.
207+ ///
208+ /// Rendered suffixes include those that are visible on hover. Hidden suffixes
209+ /// are excluded.
210+ bool get hasVisibleSuffixes => itemSuffixes.any ((suffix) => suffix.isVisible);
211+
206212 @override
207213 String toString () => {
208214 'label' : label,
Original file line number Diff line number Diff line change @@ -204,6 +204,13 @@ class SelectableMenuItem<ItemType> extends PropertyChangeNotifier
204204 _selectableState = value;
205205 notifyPropertyChange (#selectableState, _selectableState, value);
206206 }
207+
208+ /// True if any of the [itemSuffixes] are rendered.
209+ ///
210+ /// Rendered suffixes include those that are visible on hover. Hidden suffixes
211+ /// are excluded.
212+ @override
213+ bool get hasVisibleSuffixes => itemSuffixes.any ((suffix) => suffix.isVisible);
207214}
208215
209216void _noOp () {}
You can’t perform that action at this time.
0 commit comments