In the handleSaveClick function, you can use the e.preventDefault() function. When the embed image button is clicked, the handleSaveClick function will be executed, e.preventDefault() should prevent the default behavior of the link, ensuring that it does not navigate to the URL.
const handleSaveClick = async (e, activity, index) => { e.preventDefault(); // 阻止默認(rèn)行為(跟隨鏈接) e.stopPropagation(); // 阻止事件冒泡 // 在這里添加你的按鈕點(diǎn)擊邏輯 // ... }
Additionally, you should consider replacing the anchor tag of a clickable area or button with another suitable element.