Jump to content

Problem with click events (Vue.js)


Chesterfield

Recommended Posts

Hey!

I have a problem while working with Vue.js

Using v-for loop in the component which data is taken from an array or object, as soon as data updates something happens that blocks click events on elements that have been rendered with the new data.
Moreover, everything works correctly in the browser, but as soon as we transfer it to the game (RAGE: MP), which has it’s own browser based on the Chromium 79.0.3945.117 core, while the data updates, the v-on:click events stop working for 10-15 seconds. After a while they work correctly, but as soon as the data updates again, the problem reappears.
This problem also occurs when the list generated by v-for is hidden using v-if. Using v-show, this problem does not appear (since elements don’t disappear from the DOM).

If you know how to solve this problem we would be happy to get help and pay for your time. Please contact us:

Discord: Cho#4955 (preferred)
Telegram: @yanekto

Link to comment
Share on other sites

  • 2 weeks later...

Its a problem with CEF browser timestamps. https://bitbucket.org/chromiumembedded/cef/pull-requests/367 this PL fixes that issue, not sure when ragemp browser will be updated or is it possible to update it yourself but in the meantime use vanilla JS 

const uniqueId = `someId${props.key}`    
onMounted(() => {
      element = document.getElementById(uniqueId);
      element && element.addEventListener("mouseup", onMouseup, false);
    });
    onBeforeUnmount(() => {
      element && element.removeEventListener('mouseup', onMouseup, false);
    })

 

Link to comment
Share on other sites

  • 11 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...