intro.js icon indicating copy to clipboard operation
intro.js copied to clipboard

fix: 🐛 ensure prev button html is updated with prevLabel option

Open marcomafessolli opened this issue 1 year ago • 1 comments

The prev button in was not updating its inner HTML to reflect changes made to the prevLabel option in the tour.

Link to issue: https://stackblitz.com/edit/introjs-prevbutton-innerhtml?file=src%2Fmain.ts

Unlike the next button, which updates its label dynamically (https://github.com/usablica/intro.js/blob/master/src/packages/tour/showElement.ts#L639, https://github.com/usablica/intro.js/blob/master/src/packages/tour/showElement.ts#L689, https://github.com/usablica/intro.js/blob/master/src/packages/tour/showElement.ts#L721), the prev button's label was set only once when the button was created.

This fix adds logic to update prevTooltipButton.innerHTML with the current prevLabel option in all relevant places, ensuring the label remains consistent with what is specified in the tour options.

Edit: forgot to mention the issue https://github.com/usablica/intro.js/issues/640

marcomafessolli avatar Aug 15 '24 15:08 marcomafessolli

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
intro-js ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 15, 2024 3:04pm

vercel[bot] avatar Aug 15 '24 15:08 vercel[bot]

@marcomafessolli thanks for the PR. We've made some changes to how the library works. Can you please check the latest beta version and see if this issue still repros?

binrysearch avatar Sep 11 '24 20:09 binrysearch

@binrysearch looks like its working nowm no need for my PR anymore. I appreciate your help and responsiveness.

marcomafessolli avatar Sep 16 '24 19:09 marcomafessolli