PricingDocsAcademy
Bluesky ...
Wed, Dec 11, 9:48 PM

Component attributes not updating in editor...

  • mdxwired

    1 month ago

    Hey all. Has there been a recent change to how/when the editor updates component attributes when the underlying linked variable or formula changes?
    My page worked perfectly in the editor yesterday and still works perfectly in 'preview' mode, but is now very erratic within the editor itself.
    I have cleared all site data (browser cache, cookies, etc...) and everything else that I can think of...
    When I pause the 'test' run and click on the attribute, the contents say that they are what they should be, they just do not pass to the component or display correctly on the page.

    Thanks in advance!!
  • Andreas Møller

    1 month ago

    No not we are not aware of any changes that would cause this
  • Jacob Kofoed

    1 month ago

    Are there any errors in the browser console? (f12)
  • mdxwired

    1 month ago

    Nope. All clear.
  • mdxwired

    1 month ago

    Ooop! Hold that thought. Found a 'buried' issue... I'm checking...
  • mdxwired

    1 month ago

    OK. Error unrelated but fixed just in case. Problem still exists.
    Further interesting diagnostic... everything updates instantly and correctly if I make any change to any other attribute of any component on the page (includng the component with the issue). That seems to force an update of ALL components on the page.
  • needtheanswers

    1 month ago

    +1 I have the same issue
  • I need to manually refresh the page in order for my component attributes to update
  • mdxwired

    1 month ago

    Interesting... for me that does not work. Some attributes display the correct information (including many that are pulling from an API on load), and others will only refresh correctly if I change some other attribute.
  • Also have tried it in two different browsers... Chrome and Opera.
  • Jacob Kofoed

    1 month ago

    Can you link the project or make a short screenshot/video so I'm 100% sure on the issue. I have not been able to recreate it thus far.
  • mdxwired

    1 month ago

    @Jacob Kofoed I will add you to the project... hang on.
  • mdxwired

    1 month ago

    @Jacob Kofoed is it just jacob?
  • Jacob Kofoed

    1 month ago

    Yup 👍
  • mdxwired

    1 month ago

    You will need to use the login page first to estalish auth for the API calls.
  • mdxwired

    1 month ago

    Hold please... trying to change a password in Supabase. I foolishly used a common one for me. Duh.
  • /attachments/1300891005561868299/1301179309901352980/Bildschirmaufnahme_2024-10-30_um_14.34.06.mov

    needtheanswers

    1 month ago

    @Jacob Kofoed In my case I´m trying do delete cart items. The calculations and the button are both components, fed with the same data. As you can see the button is updating as soon as the request finishes but as for the calculations I would need to refresh the page manually
  • needtheanswers

    1 month ago

    @mdxwired Any news on this? Were you guys able to solve this?
  • Jacob Kofoed

    1 month ago

    I think I would need to see the project to help you with the specific issue. Do you have a link to it that I can see? For @mdxwired we tried some different approaches. I'm not sure we know for sure, but the issue might have been related to how APIs are not guarenteed to be loaded server side in the editor vs. preview.
  • needtheanswers

    1 month ago

    Gonna send you a DM right away. And thank you for the information regarding @mdxwired 's project
  • needtheanswers

    1 month ago

    So in my case the problem was that I was using a variable to set the lines of the calculations when I should have used a formula to do so instead. "Variables with a default value are only updated the first time, but will not update their values automatically when attributes change" Thank you @Jacob Kofoed for explaining this to me and solving my issue.
    💪1
    👍1
  • mdxwired

    1 month ago

    Sorry. Yes. I needed to use internal component variables because one cannot directly change attributes from within, and I did not want my components 'bouncing' in and out with every click. That said, a reasonably clever use of the "Attribute Changed" event allowed me to 'catch' the delayed update of the API-fed attribute that was lagging behind. I simply grab the initial state of all attributes on the way in the first time, set my internal variable(s) accordingly, and then use "Attribute Changed" to check to see what changed and decide if I need to update the variable first set above. Works every time now.!!! 😎
    💪1
  • mdxwired

    1 month ago

    The 'need' for internal variables described above is due to the interdependence of some of my internal mechansisms (things that change or update based upon the changing states of other things).

Stop scrolling. Start building.

toddle is a visual web app builder that rivals custom code — but accessible to your entire team!

Try toddle — it's free!

© Copyright 2024 toddle. All rights reserved.