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

Cannot read properties of undefined (reading 'label') #1552

Open
GiancarlosIO opened this issue Feb 27, 2023 · 1 comment
Open

Cannot read properties of undefined (reading 'label') #1552

GiancarlosIO opened this issue Feb 27, 2023 · 1 comment

Comments

@GiancarlosIO
Copy link

GiancarlosIO commented Feb 27, 2023

Do you want to request a feature or report a bug?
no

What is the current behavior?
There is an error "Cannot read properties of undefined (reading 'label')" when initializing the editor.

image
image

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem.

  • Install version 1.5.28
  • Initialize the editor using the following code:
alloyEditorRef.current = AlloyEditor.editable('editor', {
        title: hint,
        toolbars: {
          add: {
            buttons: ['image'],
            tabIndex: 2,
          },
          styles: {
            selections: [
              {
                name: 'link',
                buttons: ['linkEdit'],
                test: AlloyEditor.SelectionTest.link,
              },
              {
                name: 'text',
                buttons: ['bold', 'italic', 'underline', 'link'],
                test: AlloyEditor.SelectionTest.text,
              },
            ],
            tabIndex: 1,
          },
        },
        extraPlugins: `${AlloyEditor.Core.ATTRS.extraPlugins.value},pastefromword,clipboard,ae_buttonbridge`,
      })
  • You will get an error TypeError: Cannot read properties of undefined (reading 'label')

What is the expected behavior?
It should initialize the editor without errors.

Which versions of alloy-editor, and which browser / OS are affected by this issue? Did this work in previous versions?
Alloyeditor: v1.5.28 (it also happens with the latest version)
Node: v16.19.1
SO: macOS

@PetkovBG
Copy link

PetkovBG commented Aug 1, 2024

Was a solution found for this issue? I have the same issue running 2.11.15 but with selection test. I get Cannot read properties of undefined reading 'link' for line:
test: AlloyEditor.SelectionTest.link

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

2 participants