Skip to content

fix: toggleDispatch do not dispatch the right event - #1998

Merged
luanfreitasdev merged 1 commit into
Power-Components:6.xfrom
MrYamous:fix-1993
Oct 7, 2025
Merged

luanfreitasdev merged 1 commit into
Power-Components:6.xfrom
MrYamous:fix-1993

Conversation

@MrYamous

@MrYamous MrYamous commented Oct 1, 2025 •

Copy link
Copy Markdown
Contributor

⚡ PowerGrid - Pull Request

  • Bug fix
  • Enhancement
  • New feature
  • Breaking change

Description

See #1993 for reporting / Demo for example

After investigation into code, i noticed the function isn't triggering the good event, this pr aims to fix that

Related Issue(s): #1993

Documentation

This PR requires Documentation update?

  • Yes
  • No
  • I have already submitted a Documentation pull request.

@davidtim

davidtim commented Oct 2, 2025 •

Copy link
Copy Markdown

I think another bug related to this one is that during $this->dispatch('pg-toggle-detail-'.$this->tableName.'-'.$rowId, collapsed: null); it won't show spinner. And if add PowerGrid::detail()->collapseOthers() the expend/collapse button won't show spinner also.

@MrYamous

MrYamous commented Oct 2, 2025

Copy link
Copy Markdown
Contributor Author

I think another bug related to this one is that during $this->dispatch('pg-toggle-detail-'.$this->tableName.'-'.$rowId, collapsed: null); it won't show spinner. And if add PowerGrid::detail()->collapseOthers() the expend/collapse button won't show spinner also.

Tbh i'm not sure to understand what is the spinner you're talking about

@davidtim

davidtim commented Oct 2, 2025

Copy link
Copy Markdown

I mean the loading indicator

@MrYamous

MrYamous commented Oct 2, 2025 •

Copy link
Copy Markdown
Contributor Author

I mean the loading indicator

Oh yes, I think this is a CSS animation specific to the collapse icon

@MrYamous

MrYamous commented Oct 2, 2025

Copy link
Copy Markdown
Contributor Author

I took a quick look : it's a css animation specific to the button that is offered by default by the package. If you want to use a specific button, it can take many forms, and I don't know if it's possible to offer an animation that is consistent with that. I think it's better to add your own classes thanks to class method

return [
    Button::make('toggleDetail', 'Click to Toggle Detail')
        ->class('btn btn-primary btn-sm custom-spinner')
        ->toggleDetail($row->id),
];

@luanfreitasdev

Copy link
Copy Markdown
Member

Thank you @MrYamous

@luanfreitasdev
luanfreitasdev merged commit 7f5a8cf into Power-Components:6.x Oct 7, 2025
23 checks passed
@MrYamous
MrYamous deleted the fix-1993 branch October 9, 2025 18:22
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.

3 participants