MOBILE-3833 collapsible: Fix disabled collapsible header on error
This commit is contained in:
		
							parent
							
								
									b25d5d5fca
								
							
						
					
					
						commit
						e750ef2c6e
					
				| @ -208,7 +208,11 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest | |||||||
|         this.expandedHeader = this.page?.querySelector('ion-item[collapsible]') ?? undefined; |         this.expandedHeader = this.page?.querySelector('ion-item[collapsible]') ?? undefined; | ||||||
| 
 | 
 | ||||||
|         if (!this.expandedHeader) { |         if (!this.expandedHeader) { | ||||||
|  |             this.enabled = false; | ||||||
|  |             this.setEnabled(this.enabled); | ||||||
|  | 
 | ||||||
|             throw new Error('[collapsible-header] Couldn\'t initialize expanded header'); |             throw new Error('[collapsible-header] Couldn\'t initialize expanded header'); | ||||||
|  | 
 | ||||||
|         } |         } | ||||||
|         this.expandedHeader.classList.add('collapsible-header-expanded'); |         this.expandedHeader.classList.add('collapsible-header-expanded'); | ||||||
| 
 | 
 | ||||||
| @ -384,11 +388,11 @@ export class CoreCollapsibleHeaderDirective implements OnInit, OnChanges, OnDest | |||||||
|      * @param enable True to enable, false otherwise |      * @param enable True to enable, false otherwise | ||||||
|      */ |      */ | ||||||
|     async setEnabled(enable: boolean): Promise<void> { |     async setEnabled(enable: boolean): Promise<void> { | ||||||
|         if (!this.page || !this.content) { |         if (!this.page) { | ||||||
|             return; |             return; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if (enable) { |         if (enable && this.content) { | ||||||
|             const contentScroll = await this.content.getScrollElement(); |             const contentScroll = await this.content.getScrollElement(); | ||||||
| 
 | 
 | ||||||
|             // Do nothing, since scroll has already started on the page.
 |             // Do nothing, since scroll has already started on the page.
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user