-
Notifications
You must be signed in to change notification settings - Fork 338
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
Fix copy title from metadata #2518
Conversation
Hrm... didn't work. Click it the first time, it doesn't copy. Alter the URL again, then click copy, and it works the 2nd time only. |
I see the issue. It works the first time if the url field loses focus, but it doesn't work the first time when you go from the url field directly to the copy button. |
i.setState({ | ||
urlBlurTimeout: setTimeout(() => { | ||
i.updateUrl(() => i.props.onUrlBlur?.(event.target.value)); | ||
}, 500), | ||
}); |
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.
A kludge. It fixes the bug at least.
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.
It still does some reloading, but the filling works correctly now. Good enough for me, and we can fix the other things in the next release.
@@ -354,6 +367,10 @@ export class PostForm extends Component<PostFormProps, PostFormState> { | |||
}, | |||
}; | |||
} | |||
|
|||
if (this.state.form.url) { | |||
this.fetchPageTitle(); |
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 calls setState in the constructor. Probably only a problem for dev builds.
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.
And should also be client side only.
There are still a few issues with both cross-posting, and copy title. We can fix them for the next bugfix release tho. |
Fixes #2516
Alternative to #2517