Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Formula module does not work with bubble theme: quill:toolbar ignoring attaching to nonexistent format formula #963

Closed
sferoze opened this issue Sep 13, 2016 · 1 comment

Comments

@sferoze
Copy link
Contributor

sferoze commented Sep 13, 2016

I am using the bubble theme and I am trying to get the formula module to work.

I have added the Katex package and Quill does detect this because without the Katex package, I get console errors.

So after adding the Katex package and in the options setting formula to true

toolbarOptions = [{ size: [ 'small', false, 'large' ]}, 'bold', 'italic', 'underline', 'strike', 'link', 'code-block', 'formula', { 'color': [] }, { 'align': [] }, 'clean']; 

    @editor = new QuillNEW @find('.quill-editor'),
      placeholder: 'Enter Text...'
      modules:
        syntax: true 
        formula: true
        toolbar: toolbarOptions
        history:
          delay: 1000
          userOnly: true
          maxStack: 50 
      theme: "bubble"

I still cannot use the formula button. The button appears in toolbar but when I click it, it does nothing.

In console I get this error:

quill:toolbar ignoring attaching to nonexistent format formula <button type=​"button" class=​"ql-formula">​…​</button>​

It does not recognize the format formula. I even tried the whitelist option of formats and specifically adding 'formula' but that does not work.

If you do this with the snow theme it DOES work. This issue is primarily with the bubble theme.

Steps for Reproduction

  1. Visit the Quill Editor in the playground
  2. Editing the JS code to be the following
var quill = new Quill('#editor-container', {
  modules: {
    toolbar: [
      [{ header: [1, 2, false] }],
      ['bold', 'italic', 'underline'],
      ['image', 'code-block', 'formula']
    ],
    formula: true
  },
  placeholder: 'Compose an epic...',
  theme: 'bubble' // or 'bubble'
});
  1. Try and add a formula, you will get the same console error.

Expected behavior:

Formula should work in both themes

Actual behavior:

Formula only works with snow theme

Platforms:

Using Quill 1.0.3 on Mac with Chrome 52.0

@sferoze
Copy link
Contributor Author

sferoze commented Sep 13, 2016

I just noticed that on a page with multiple quill editors.

The first editor on the page does not work with the formula module.

But the editors below do work with it. I wonder whats going on? In the playground since there is only one editor, it does not work.

@jhchen jhchen closed this as completed in 751125f Sep 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant