Skip to content

Core | Page issue: toggled/hidden fab reappears when you leave and return to its page. #2558

@bobOnGitHub

Description

@bobOnGitHub

Environment

[Core]
  onsenui latest
  
[Platform]
  Desktop - Windows 10 64-bit

[Browser]
  Desktop - Firefox 62.0 on Windows 10 64-bit

Encountered problem

toggled/hidden fab reappears when you leave and return to its page.

How to reproduce

Click on the dialFab fab - it disappears as intended.
click on the tabbar graph/results icon - gui switches to results page as intended.
click on tabbar edit/crud icon - gui switched back to crud page as intended BUT fab reappears which is NOT intended.

Demo link

  • HTML
        <ons-tabbar swipeable position="auto">
            <ons-tab page="crud"  icon="md-edit"  active>
            </ons-tab>
            <ons-tab page="results"  icon="md-chart" >
            </ons-tab>       
          </ons-tabbar>   
        
        <ons-template id="crud">
            <ons-page>
                <p style="text-align: center;">CRUD</p>                        
                <p style="text-align: center;"><ons-icon icon="md-edit"></ons-icon></p>
                
                <ons-fab id="dialFab" position='bottom right'>
                    <ons-icon icon="md-dialpad"></ons-icon>
                </ons-fab>       
                
            </ons-page>
        </ons-template>        

        <ons-template id="results">
            <ons-page>
                <p style="text-align: center;">RESULTS</p>                        
                <p style="text-align: center;"><ons-icon icon="md-chart"></ons-icon></p>
            </ons-page>
        </ons-template>
  • JS
let style = document.createElement('style');
style.innerHTML = "#dialFab *{pointer-events: none;}" ;
document.head.appendChild(style);   

document.addEventListener("click",function(e){
    //alert(e.target.id);
    if(e.target.id === "dialFab"){
      e.target.toggle();
    }
  }
);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions