MCPcopy Index your code
hub / github.com/ionic-team/ionic-framework / updateState

Method updateState

core/src/components/menu/menu.tsx:798–829  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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;

Callers 11

disabledChangedMethod · 0.95
swipeGestureChangedMethod · 0.95
connectedCallbackMethod · 0.95
componentDidLoadMethod · 0.95
onSplitPaneChangedMethod · 0.95
AccordionClass · 0.45
valueChangedMethod · 0.45
connectedCallbackMethod · 0.45
valueChangedMethod · 0.45
componentDidLoadMethod · 0.45
connectedCallbackMethod · 0.45

Calls 3

_isActiveMethod · 0.95
afterAnimationMethod · 0.95
enableMethod · 0.65

Tested by

no test coverage detected