Onsen + React: Uncaught (in promise) Splitter side is locked



  • Hey folks. I’m seeing this error show up in logs when I select a menu item in a splitter side and then collapse the side:

    onsenui.js?a680:22060 Uncaught (in promise) Splitter side is locked

    ons.notification.confirm(
    {
        message: "Do you really want to Logout?",
    
        callback: ( answer ) =>
        {
            if ( answer === 1 )
            {
                this.props.logout();
    
                this.setState(
                {
                    showMenu: false
                } );
            }
        }
    } );
    

    The showMenu state controls whether the splitter side is shown or not. Am I doing something wrong here?

    Thanks!


  • Onsen UI

    @sherscher That error means that the splitter is already busy making an animation. This can happen if you slide the menu to close it and at the same time you press an item that triggers the close function again (2 different things are telling the splitter to close). If the result you get is fine, i.e. the splitter closes and opens normally, you can safely ignore this message.



  • Thanks Fran!



  • @Fran-Diox has there been any control over this? My situation is a Router wrapping my Splitter so that I get proper animation on page changes triggered through the SplitterSide.

    When I click to transition, I have to manually set my component state to change isOpen to false. This causing it to trigger the error, when when isOpen is only changed once.

    Even being able to manage the promise to safely ignore it would be very helpful.


Log in to reply