Dogstudio / highway

Highway - A Modern Javascript Transitions Manager
https://highway.js.org/
MIT License
1.43k stars 92 forks source link

New href with highway #108

Closed stonners closed 3 years ago

stonners commented 3 years ago

Hello i have a problem i am using the highway for the transition and i am using paginator which allows em to parse a big data stream, however when i click the button to show more content the do not give their href to highway so that highway takes them as external links. I already tried to do "H.attatch (myVar)" but it didn't work Capture d’écran 2021-06-08 à 10 17 25

stonners commented 3 years ago

this.bind is just a test like found in other issues but doesn't work

ThaoD5 commented 3 years ago

Hello @stonners what exactly are you trying to achieve, or expect to happen ?

stonners commented 3 years ago

I expect that when I press my button to add new items, highway takes into account the new href and therefore that the links remain internal, without reloading

ThaoD5 commented 3 years ago

Have you console.logged your ctx array and compared the items in it ? Are there "new" items in the array ?

stonners commented 3 years ago

yeah, it s a node list and i have my news items in

ThaoD5 commented 3 years ago

A live demo with console logs would be useful here, could you provide that. ?

stonners commented 3 years ago

I display 6 items at a time, and I can clearly see the new items, but i think highway dont attach my new href

Capture d’écran 2021-06-08 à 11 20 47

ThaoD5 commented 3 years ago

What's the forEach for ?

stonners commented 3 years ago

what foreach?

stonners commented 3 years ago

it's just a structure, they are containers and in the containers, I have with divs in them

ThaoD5 commented 3 years ago

On the object.values

ThaoD5 commented 3 years ago

I think your issue might come from there, you're looping too much on the new link elements you added

ThaoD5 commented 3 years ago

I would advise you to just do the querySelector on the document + bind once on the ajax update event you have, that should do the trick.