()
| 796 | } |
| 797 | |
| 798 | private updateState() { |
| 799 | const isActive = this._isActive(); |
| 800 | if (this.gesture) { |
| 801 | this.gesture.enable(isActive && this.swipeGesture); |
| 802 | } |
| 803 | |
| 804 | /** |
| 805 | * If the menu is disabled but it is still open |
| 806 | * then we should close the menu immediately. |
| 807 | * Additionally, if the menu is in the process |
| 808 | * of animating {open, close} and the menu is disabled |
| 809 | * then it should still be closed immediately. |
| 810 | */ |
| 811 | if (!isActive) { |
| 812 | /** |
| 813 | * It is possible to disable the menu while |
| 814 | * it is mid-animation. When this happens, we |
| 815 | * need to set the operationCancelled flag |
| 816 | * so that this._setOpen knows to return false |
| 817 | * and not run the "afterAnimation" callback. |
| 818 | */ |
| 819 | if (this.isAnimating) { |
| 820 | this.operationCancelled = true; |
| 821 | } |
| 822 | |
| 823 | /** |
| 824 | * If the menu is disabled then we should |
| 825 | * forcibly close the menu even if it is open. |
| 826 | */ |
| 827 | this.afterAnimation(false, GESTURE); |
| 828 | } |
| 829 | } |
| 830 | |
| 831 | render() { |
| 832 | const { type, disabled, el, isPaneVisible, inheritedAttributes, side } = this; |
no test coverage detected