Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] selection of a day in one of the widgets selects the day in other widgets #20

Open
sriharshaj70 opened this issue Oct 10, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@sriharshaj70
Copy link

Describe the bug
When using multiple SelectWeekdays Widgets in the same app results in incorrect selections. If you select a day in one widget (say Monday in Widget 1) and go to another widget, say Widget 2 and enable day Tuesday, then the display in widget 2 shows
both Monday and Tuesday as selected. However, onPressed() returns the correct results.

To Reproduce
Steps to reproduce the behavior:
Execute the example code given in this repository.

  • Click on the first circle (Zo) in the first widget
  • Click on the second circle (Ma) in the second widget
  • You can see both Zo and Ma selected in the second widget

Expected behavior
Only 'Ma' selected in the second widget

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: Android emulator emulating Pixel 7
  • OS: Android
  • Version 2.2.0

Additional context

@sriharshaj70 sriharshaj70 added the bug Something isn't working label Oct 10, 2023
@shan-shaji
Copy link
Owner

Hey @sriharshaj70 , Would you like to work on it?

@sriharshaj70
Copy link
Author

Right now I don't have time to look at this. May be a week from now.
The issue is that widget is using the supplied instance of days itself to modify the selection state.
Fix can be in the widget OR in the example code to deepcopy the days instance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants