Skip to content

JS errors in Safari browser when using the plugin system #333

Answered by idiotWu
itwork46 asked this question in Q&A
Discussion options

You must be logged in to vote

The class field syntax is not yet supported in Safari, so you may need a transpiler like babel, or move the static ... = declarations out of the classes:

// Init Scrollbar Plugin
class BlockScroll extends Scrollbar.ScrollbarPlugin {
  transformDelta(delta) {
      return this.options.open ? {
          x: 0,
          y: 0
      } : delta;
  }
}

BlockScroll.pluginName = 'modal';
BlockScroll.defaultOptions = {
    open: false,
};
  
Scrollbar.use(BlockScroll);

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by idiotWu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants
Converted from issue

This discussion was converted from issue #298 on June 10, 2021 16:48.