#Range Slider Not Updating

1 messages · Page 1 of 1 (latest)

sour sky
#

Background:
I have a range slider on two different pages and it remembers the state it was in from one page to the other with storeValue onValueChange and default values being those stored values.
I am running the Cloud version of Appsmith.
Bug reproduction:
Step 0: On Page A launch, slider default start value is {{appsmith.store.RevStart|| 0}} (RevStart is initially set to 0 from a login screen, so this "or" logic is redundant just in case).
Step 1: On Page A, drag slider start to 25. onStartValueChange sets RevStart: storeValue('RevStart', SiteRevenueSlider.start); and RevStart becomes 25.
Step 2: Go to Page B. The slider accurately portrays the selection at 25.
Step 3: Drag the slider start to 0. BUG: Even though this slider also has onStartValueChange storeValue('RevStart', SiteRevenueSlider.start); the value for RevStart does not change on this very first attempt. I have to drag the start slider elsewhere in order to get it working again. This bug only happens when I try to drag the start from a non zero to zero value on a second page.

https://www.loom.com/share/a7433c9d71a14ea0bafe2fa819a9ac9e?sid=76f9ebd7-32b6-4afb-a1c1-0d3c1e727093

pale frostBOT
#

Hello! I'm AppsmithBot, here to help you with your Appsmith queries.

The issue you're experiencing with the range slider not updating the storeValue when set to zero might be related to how the onStartValueChange event is triggered. The onChange action of a widget is typically triggered when a user interacts with it, not when its default value changes.

To address this, you can try the following workaround:

  1. Ensure that the onStartValueChange event is correctly set to update the storeValue even when the value is set to zero.
  2. You might need to add a small delay or use a setTimeout to ensure the value is stored correctly, as sometimes the immediate change to zero might not trigger the event as expected.

If the issue persists, it might be a bug that needs further investigation. You can report it to the Appsmith support team for a more detailed analysis. Let me know if you need further assistance!

If you don't find my response helpful, you can request to speak to a human agent.

sour sky
#

I ensured the onStartValueChange updates the storeValue no matter the value, and changed the storeValue to include this delay on both pages:
setTimeout(() => {
storeValue('RevStart', SiteRevenueSlider.start);
}, 500);

However, the SiteRevenueSlider.start does not update during the bug I explained, so I feel like it is a bug related to the slider, not the RevStart?

pale frostBOT
#

It seems like you've implemented a delay to ensure the storeValue is updated, but if the SiteRevenueSlider.start itself is not updating, it could indeed be an issue with the slider widget.

Here are a few additional steps you can try to troubleshoot or work around the issue:

  1. Check Slider Configuration: Ensure that the slider's properties are correctly configured on both pages, especially the onStartValueChange event.

  2. Console Logging: Add a console.log(SiteRevenueSlider.start) inside the setTimeout to verify if the slider's start value is being captured correctly when you attempt to set it to zero.

  3. Alternative Event Handling: Consider using a different event or logic to trigger the storeValue update, such as a button click or another user action, to see if the issue persists.

  4. Appsmith Support: If the problem continues, it might be a bug with the slider widget. I recommend reaching out to Appsmith support with detailed information about the issue, including steps to reproduce it and any console logs that might help diagnose the problem.

If you need further assistance, feel free to ask!

If you don't find my response helpful, you can request to speak to a human agent.

sour sky
#

Range Slider Not Updating

pale frostBOT
#

It seems like the issue you're experiencing with the range slider not updating when set to zero might be related to how the onStartValueChange event is triggered. The onChange action of a widget is typically triggered when a user interacts with it, not when its default value changes.

Here are a few suggestions to troubleshoot or work around the issue:

  1. Console Logging: Add a console.log(SiteRevenueSlider.start) inside the setTimeout to verify if the slider's start value is being captured correctly when you attempt to set it to zero.

  2. Alternative Event Handling: Consider using a different event or logic to trigger the storeValue update, such as a button click or another user action, to see if the issue persists.

  3. Appsmith Support: If the problem continues, it might be a bug with the slider widget. I recommend reaching out to Appsmith support with detailed information about the issue, including steps to reproduce it and any console logs that might help diagnose the problem.

If you need further assistance, feel free to ask!

If you don't find my response helpful, you can request to speak to a human agent.

pale frostBOT
#

Hi @sour sky! We've tried this on our end, seems like the issue only happens on edit mode. If you deploy your app, the slider and store interactions should work as expected.

Could you please help us file a bug using this link?

Please add details about your use case, steps to reproduce, and the way it is impacting you. Once you file the GitHub issue, please share the link to it with us, so we can forward it to our development team.

GitHub

GitHub is where people build software. More than 150 million people use GitHub to discover, fork, and contribute to over 420 million projects.

sour sky
pale frostBOT
#

Someone from our team will reach out to you on this thread. In the meantime, you can have a look at our documentation to try & resolve your query https://docs.appsmith.com?utm=bot

Organizations build internal applications such as dashboards, database GUIs, admin panels, approval apps, customer support tools, etc. to help improve their business operations. Appsmith is an open-source developer tool that enables the rapid development of these applications. You can drag and drop pre-built widgets to build UI. Connect securely...

pale frostBOT
#

Please share the following information to help us debug this issue:

  1. Send us a loom.com screen recording showing the exact steps you take and the issue in action.
  2. Can you please share this app with us to debug this scenario? Add [email protected] as a Developer and send us the link to it.