phanan / vue-linkify

A simple Vue directive to turn URL's and emails into clickable links
83 stars 16 forks source link

Does not trigger re-render on props change #12

Open yuichkun opened 3 years ago

yuichkun commented 3 years ago

TL;DR

Hi, thank you very much for this awesome library!

Although this works with many cases, I found a situation where v-linkified component does not re-render after changes via props, data, computed, etc.

Reproduction

Demo: https://vue-linkify-not-working-demo.vercel.app/

Source Code: https://github.com/yuichkun/repro-vue-linkify-bug

Possible Fix?

I guess this bug derives from the fact that this library gets text values from el.innerHTML, so if there's a way to get text from vNode, it could avoid referencing the old value??

I'm not too familiar with Vue.js but if @phanan is busy, I'm up for trying making up a fix PR myself :)

phanan commented 3 years ago

You're always welcome to create a PR :)

Am Di., 23. März 2021 um 09:42 Uhr schrieb Yuichi Yogo < @.***>:

TL;DR

Hi, thank you very much for this awesome library!

Although this works with many cases, I found a situation where v-linkified component does not re-render after changes via props, data, computed, etc. Reproduction

Demo: https://vue-linkify-not-working-demo.vercel.app/

Source Code: https://github.com/yuichkun/repro-vue-linkify-bug Possible Fix?

I guess this bug derives from the fact that this library gets text values from el.innerHTML, so if there's a way to get text from vNode, it could avoid referencing the old value??

I'm not too familiar with Vue.js but if @phanan https://github.com/phanan is busy, I'm up for trying making up a fix PR myself :)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/phanan/vue-linkify/issues/12, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB5O3UQOQG2UAJIXX4BIMR3TFBIAHANCNFSM4ZUW3PJA .

yuichkun commented 3 years ago

@phanan Thank you! Although I noticed that I have a slight misunderstanding in the first place, I did create a PR, would you mind taking a look when you are free?