question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[v2] Plugin page callbacks not called on inline index page

See original GitHub issue

This is a (multiple allowed):

  • bug
  • enhancement
  • feature-discussion (RFC)

  • Framework7 Version: 2.0.5
  • Platform and Target: Google Chrome on MacOS High Sierra

What you did

Tried to port upscroller plugin to v2.

Expected Behavior

When inline page “index” is opened, event pageBeforeIn should be called. – At least in v1 this was the old behavior.

Actual Behavior

Event is not called. But when a new file about.html with page name “about” is created and I open this page through a link <a class="link" href="/about/">to about</a>, then pageBeforeIn is called correctly.

Is this expected behavior or a bug?

Code Example

Test HTML

<div id="app">
   <div class="view view-main">
      <div class="pages">
         <div data-name="index" class="page" data-page="index">
            <div class="page-content main">
               <a class="link" href="/about/">to page 2</a>
            </div>
         </div>
      </div>
   </div>
</div>

about.html

<div class="page" data-page="about">
  <div class="page-content">
    <p>About page</p>
  </div>
</div>

Init code

Framework7.use(f7UpscrollerPlugin);

var app = new Framework7({
    root: '#app',
    upscroller: true,
    routes: [{
        path: '/about/',
        url: 'about.html',
    }],
});

var mainView = app.views.create('.view-main');

Plugin code

f7UpscrollerPlugin = {
    name: 'upscroller',
    params: {
        text: 'Go up',
        ignorePages: []
    },
    on: {
        init: function() {
            /*
               This gets called correctly on app start. However, I miss
               "page" parameter because I need to check if the current
               page is listed in `app.params.ignorePages`.
            */
        },
        pageBeforeIn: function(page) {
            // Not called for index page :-(
            // But for "about" page this gets called correctly.
        },
    }
};

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:17 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
nolimits4webcommented, Jan 12, 2018

Yeah, that was for example, refer to all router events list at https://framework7.io/docs/view.html#router-instance-events

0reactions
valnubcommented, Jan 15, 2018

@nolimits4web Ok, cool thanks Vladi 😄 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

What are some reasons why callbacks fail to function after I ...
Based on the most recent video, I converted my app to a multi-page app. but the callbacks no longer fire. I've been working...
Read more >
Callback is not called in add_settings_field() when passed as ...
I have a folder called SettingsAPI, with the following namespace namespace Blocks\Pages\SettingsAPI; Inside that folder, I have three files: AddSettings.php , ...
Read more >
Multi-Page Dash App Callbacks Not Registering
When I go to my second page, the content loads fine but the callback does not, so selecting an item from the drop...
Read more >
dash-labs/08-MultiPageDashApp.md at main - GitHub
This plugin allows users to simply place their layouts in pages/ and call dash.register_page with the desired URL path of that page. This...
Read more >
Callback plugins - Ansible Documentation
By default, callback plugins control most of the output you see when running the command line programs, but can also be used to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found