ubports / ubuntu-ui-toolkit

Moved to https://gitlab.com/ubports/core/lomiri-ui-toolkit
https://gitlab.com/ubports/core/lomiri-ui-toolkit
GNU Lesser General Public License v3.0
13 stars 21 forks source link

AdaptivePageLayout.addPageToNextColumn and addPageToCurrentColumn doesn't return the object incubator #51

Closed dark-eye closed 3 years ago

dark-eye commented 4 years ago

It seem that the docuimentaion suggest that calling addPageToNextColumn/addPageToCurrentColumn will return the object incubator which then can be use to remove the loaded page however it currently will always return null.

It seems the the issue is that in the code it return wrapper.incubator however this object is never created in the createWrapper function :

        function createWrapper(page, properties) {
            var wrapperObject = pageWrapperComponent.createObject(hiddenPages, {synchronous: !layout.asynchronous});
           ...
           return wrapperObject;

this means that the addPageToNextColumn/addPageToCurrentColumn should actullay return wrapper instead of wrapper.incubator

lduboeuf commented 3 years ago

just to test, does adding asynchronous: false to the AdpativeLayout fix the issue ?

dark-eye commented 3 years ago

@lduboeuf (as far as i remember) its that it returns the wrong object and that an object that is never created as far as i understood. however if adding asynchronous: false will create thewrapper.incubator` field in the wrapper then maybe we need to add a check to return the incobutor on async=true mode and the wrapper on async=false

UniversalSuperBox commented 3 years ago

Ubuntu UI Toolkit has moved to https://gitlab.com/ubports/core/lomiri-ui-toolkit. If this issue is still relevant, please file it again at https://gitlab.com/ubports/core/lomiri-ui-toolkit/-/issues.