Skip to content

fix: skip initial formset rows in syncDeletedRows - #199

Merged
MartinCervenkaSB merged 2 commits into
mainfrom
fix_formset_initial_row_delete
Jul 7, 2026
Merged

fix: skip initial formset rows in syncDeletedRows#199
MartinCervenkaSB merged 2 commits into
mainfrom
fix_formset_initial_row_delete

Conversation

@ViktorBojda

Copy link
Copy Markdown
Contributor

Do not hide rows marked with data-sbadmin-formset-initial-row when their DELETE checkbox is checked. Saved rows should stay visible (marked for deletion); only newly added rows should be hidden via syncDeletedRows.

Viktor Bojda added 2 commits July 7, 2026 10:25
Do not hide rows marked with data-sbadmin-formset-initial-row when their
DELETE checkbox is checked. Saved rows should stay visible (marked for
deletion); only newly added rows should be hidden via syncDeletedRows.
@ViktorBojda
ViktorBojda force-pushed the fix_formset_initial_row_delete branch from f75c237 to 07ec941 Compare July 7, 2026 08:26
@ViktorBojda ViktorBojda self-assigned this Jul 7, 2026
@MartinCervenkaSB
MartinCervenkaSB merged commit f1ef064 into main Jul 7, 2026
3 checks passed

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f75c237c11

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment on lines +123 to +124
if (row.hasAttribute(INITIAL_ROW_ATTR)) {
return

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Keep initial rows visible after delete clicks

When a saved row marked with data-sbadmin-formset-initial-row is deleted via a data-sbadmin-formset-delete-row button, deleteFormsetRow() has already checked the DELETE input and added .hidden before calling syncDeletedRows(). This new early return then skips the only code that could reconcile the row visibility, so the saved row still disappears instead of staying visible while marked for deletion. The initial-row path needs to avoid the immediate hide or explicitly remove .hidden here.

Useful? React with 👍 / 👎.

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.

2 participants