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

Solve problem with unset batch checkbox`s after back via browser history #6466

Merged
merged 2 commits into from
Oct 12, 2020
Merged

Solve problem with unset batch checkbox`s after back via browser history #6466

merged 2 commits into from
Oct 12, 2020

Conversation

kirya-dev
Copy link
Contributor

Subject

I am targeting this branch, because would like make better sonata-admin.

Closes #6430.

Changelog

### Fixed
- Solve problem with unset batch checkbox`s after back via browser history

@VincentLanglet
Copy link
Member

Can you confirm that you tried it on your project and it worked ?

@kirya-dev
Copy link
Contributor Author

Can you confirm that you tried it on your project and it worked ?

Of course. Checked this in google chrome 85.

VincentLanglet
VincentLanglet previously approved these changes Oct 9, 2020
@VincentLanglet VincentLanglet requested a review from a team October 9, 2020 11:23
core23
core23 previously approved these changes Oct 9, 2020
Copy link
Member

@core23 core23 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand how this could have an inpact to this bug, but it won't break anything.

@VincentLanglet
Copy link
Member

I don't understand how this could have an inpact to this bug, but it won't break anything.

https://stackoverflow.com/questions/37933043/reset-checkbox-checked-state-go-back-from-history

@franmomu
Copy link
Member

franmomu commented Oct 9, 2020

I remember struggling with iCheck some time ago. In this case looks more like an iCheck issue, maybe we should make some call to update the iCheck checkboxes after loading the page.

@kirya-dev
Copy link
Contributor Author

I remember struggling with iCheck some time ago. In this case looks more like an iCheck issue, maybe we should make some call to update the iCheck checkboxes after loading the page.

What is expected result? Checkboxes are show checked or not?

@franmomu
Copy link
Member

franmomu commented Oct 9, 2020

Ok! I thought we wanted to check the previously selected boxes.

Can you please also change it in

<input type="checkbox" name="idx[]" value="{{ admin.id(object) }}">

@kirya-dev kirya-dev dismissed stale reviews from core23 and VincentLanglet via 8c8258f October 11, 2020 19:01
Copy link
Member

@VincentLanglet VincentLanglet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like you totally change your strategy to fix the issue ?
Previously you added autocomplete=false, can you explain the new strategy ?

src/Resources/public/Admin.js Outdated Show resolved Hide resolved
@kirya-dev
Copy link
Contributor Author

kirya-dev commented Oct 12, 2020

Seems like you totally change your strategy to fix the issue ?

Yes. @core23 says that want to see previously checked inputs.

@VincentLanglet
Copy link
Member

Seems like you totally change your strategy to fix the issue ?

Yes. @core23 says that want to see previously checked inputs.

Ok, I think that's a good idea indead.

WDYT about adding a comment to explain this, something like

// In case some checkbox are already checked (for instance after a back via browser history), update iCheck checkboxes
if (subject === window.document)
...

VincentLanglet
VincentLanglet previously approved these changes Oct 12, 2020
@VincentLanglet VincentLanglet requested a review from a team October 12, 2020 10:01
Co-authored-by: Javier Spagnoletti <[email protected]>
@VincentLanglet VincentLanglet requested review from phansys and a team October 12, 2020 18:28
@VincentLanglet VincentLanglet merged commit 6d32a6f into sonata-project:3.x Oct 12, 2020
@VincentLanglet
Copy link
Member

Thanks @kirya-dev

@kirya-dev kirya-dev deleted the closes-issue-6430 branch October 13, 2020 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Batch actions operate on unselected objects
5 participants