orchidsoftware / orchidsoftware/platform

Switcher status does not update correctly

Open
#1,759 0 comments 0 reactions 1 assignee View on GitHub

@tabuna is already working on this.

Since Jun 7, 2021.

Errors
Dominant language
PHP
Stars
4.8k
Forks
662
Avg merge
1d 9h
Merged PRs (30d)
7

Description

Describe the bug
I'm trying to develop an inline function ('onchange' event in list screen ) using the Switcher component. At the moment I'm just changing the switcher by clicking it and nothing else. If I click the switch, say from ON to OFF ( I get the data from DDBB registry which the value is 1), then the switch is correctly displayed but if I refresh the page by reloading with F5 then the switcher keeps it state in unchecked but it should display checked since in DDBB its value remains in 1.

BTW: If I reload the page with Control + F5 then the switch displays as expected. Maybe some kind of cache bug related?

To Reproduce
Steps to reproduce the behavior:

  1. Put a Switcher component into a Screen. Make the Switcher value picks a boolean data from a DDBB registry. Ensure registry boolean value is 1
  2. Change the Switcher by clicking it.
  3. Refresh the page by pressing F5
  4. Switch status keeps in unchecked state (but it should be checked).

Expected behavior
The switcher status should be checked after pressing F5 if the registry in DDBB is 1 and should be unchecked if is 0.

Screenshots
Not applicable

Desktop (please complete the following information):

  • OS: Ubuntu 20.04 LTS
  • Browser Firefox
  • Version 89.0 (64-bit)

Server (please complete the following information):

  • Platfrom Version: 10.4.2
  • Laravel Version: 8.32.1
  • PHP Version: 7.4
  • Database: MySql
  • Database Version: 8.0.25

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.