-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Clean up empty links placeholders #1446
Conversation
I'm seeing these two bugs, can you reproduce:
|
@youknowriad I can't reproduce the first issue. What URLs are you entering? |
@iseulde can't reproduce anymore :(. I should have recorded. |
Unsure why autofocus is not working. |
@iseulde I think it's probably the removed |
I checked, but doesn't look like it. |
@youknowriad This is super strange... Added the following: componentDidUpdate() {
console.log( this.state.linkValue, document.activeElement )
} And it looks all good: But the input field seems to focus super quick, then loses focus. Even after some time, |
Maybe it's focusing another similar input, remaining somewhere hidden in the DOM? Really weird, I can't think of an explanation. |
No, when you hover over the element in the console, it highlights the right one. |
Having a hard time debugging this... Not sure at all what's going wrong. |
I'll plan to take a look later |
@@ -141,12 +145,14 @@ class FormatToolbar extends Component { | |||
} ); | |||
} | |||
|
|||
const isEditingLink = this.state.isEditingLink || this.state.linkValue === '#'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the line causing the focus error. I can't understand why but if you drop the || this.state.linkValue === '#'
it will work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason behind adding this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, this like is not needed anymore, but it doesn't fix the issue for me. The input field still won't autofocus.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it's this line combined with the setTimeout
@youknowriad, still planning to look at this one? @iseulde is it still relevant? I can try to review it next wee :) It needs rebase. |
I think this has been superseded by #2302 |
Fix errors on link input: Errors on link input #680.Fixed in 00c9bbe.