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

Writer field: getting console error when no buttons available for inline mode #6863

Open
afbora opened this issue Dec 10, 2024 · 8 comments · May be fixed by #6877
Open

Writer field: getting console error when no buttons available for inline mode #6863

afbora opened this issue Dec 10, 2024 · 8 comments · May be fixed by #6877
Assignees
Labels
type: bug 🐛 Is a bug; fixes a bug
Milestone

Comments

@afbora
Copy link
Member

afbora commented Dec 10, 2024

Description

Getting console error when no marks or nodes available for inline mode. Try to select a text in writer field and check the console.

writer:
    type: writer
    marks: false
    nodes: false

TypeError: this.$el.getBoundingClientRect is not a function

Your setup

Kirby Version

4.5.0

@afbora afbora added the type: bug 🐛 Is a bug; fixes a bug label Dec 10, 2024
@distantnative
Copy link
Member

@afbora That isn't by any chance also fixed by #6846?

@afbora
Copy link
Member Author

afbora commented Dec 11, 2024

@distantnative No. That PR fixes the fixed toolbar at the top. I think the problem is related to the toolbar that appears in inline mode.

@afbora
Copy link
Member Author

afbora commented Dec 11, 2024

@distantnative We can fix this issue in #6846 with just one line. Do you want to me push fix commit to #6846 ?

@afbora afbora self-assigned this Dec 11, 2024
@afbora afbora added this to the 4.6.0 milestone Dec 11, 2024
@distantnative
Copy link
Member

@afbora what line is it?

@afbora
Copy link
Member Author

afbora commented Dec 11, 2024

@distantnative

open() {
+  if (this.buttons.length === 0) {
+    return;
+  }

  this.isOpen = true;
	
  if (this.inline) {
  this.$nextTick(this.setPosition);
}

open() {
this.isOpen = true;
if (this.inline) {
this.$nextTick(this.setPosition);
}
},

@distantnative
Copy link
Member

Does it also works with check if the this.$refs.toolbar exists?

@afbora
Copy link
Member Author

afbora commented Dec 11, 2024

@distantnative Error is gone when I test with following but inline toolbar is completely missing as default writer field:

open() {
  if (!this.$refs.toolbar) {
    return;
  }
  
  // other codes..
}

@afbora
Copy link
Member Author

afbora commented Dec 11, 2024

You checked buttons.length for that issue. I think also it would be nice fix for this issue.

open() {
  if (this.buttons.length === 0) {
    return;
  }
  
  // other codes..

@afbora afbora linked a pull request Dec 20, 2024 that will close this issue
5 tasks
@afbora afbora linked a pull request Dec 20, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Is a bug; fixes a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants