Fixed adding dependencies for editing by reference to the change
- [x] I've read and understood the contribution guidelines.
- [x] I've searched for any related issues and avoided creating a duplicate issue.
Please give us a description of what happened.
When we use the edit-link from the plugin, there is a problem that when we focus on another edit-link, we keep the state of the previous one and the state of the current one does not match reality
How can we reproduce this behavior?
- Select several parts of the text and create an edit link
- Open any edit-link and change something
- Then change the focus to another edit-link
The state of the previous one will be saved to the current one, after which there will continue to be a constant copying of states when focusing on other links from edit-link
As a quick fix i used following snippet.
onChangeLink = () => { ... } ( [ linkValue ] ); // Add dependencies
Technical info
- WordPress version:
- Yoast SEO version:
- If relevant, which editor is affected (or editors):
- [ ] Classic Editor
- [x] Gutenberg
- [ ] Classic Editor plugin
Hi @Zilero232
Thanks for using the Yoast SEO plugin and for creating the issue.
Can you share more details about the issue you are noticing with a screenshot or video using Loom or other tools you prefer to help us better understand the issue you are facing?
We look forward to hearing from you and are happy to help you.
@josevarghese Hello, if we create two links and open a modal window to change the settings of these links, and if we click on the second link when the cursor is on the first link and try to change the settings, then the first link will be changed instead of the second link and the cursor, as we see after clicking on SAVE, the settings of the first link will be changed
Video: https://github.com/Yoast/wordpress-seo/assets/68345676/2f6c39e5-5879-4d43-a83a-9d5da12c1da1
Need add dependencies for function onChangeLink = () => { ... } ( [ linkValue ] ); // Add dependencies
Hi @Zilero232
Thanks for the video. A hyperlink should be added for words or sentences. However, within your video, I noticed that the two links were added for a single word without any space in between them to differentiate them. I tried to link the words in a sentence on my lab site for two words and noticed that link settings are saved without any issues. See the screencast over here for your reference: https://www.loom.com/share/45e36684e3554325a91f45696e76e3a3.
So, can you please try adding a space between the words to make them separate words and then adding the links for each word?
We look forward to hearing from you.
Closing this issue due to inactivity. If the issue persists, please provide additional information so that we can investigate it further.