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

Fix click event bubbling in Table::onRowClick() #1655

Merged
merged 27 commits into from
Sep 7, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test, CS
mkrecek234 committed Sep 2, 2022
commit a1b6ea409cb0c2d5ad2520910fca47ed5a6a63fa
2 changes: 1 addition & 1 deletion demos/collection/grid.php
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@

$grid->addDecorator($model->titleField, [Table\Column\Link::class, 'url' => 'https://hmpg.net']);

$grid->table->onRowClick(function() {
$grid->table->onRowClick(function () {
return new JsToast(['message' => "Clicked on row"]);
});

4 changes: 2 additions & 2 deletions tests/TableColumnLinkTest.php
Original file line number Diff line number Diff line change
@@ -155,7 +155,7 @@ public function testLink1(): void
);

static::assertSame(
'<tr data-id="1"><td><a href="example.php?id=1">bar</a></td><td>ref123</td></tr>',
'<tr data-id="1"><td class="atk4-norowclick"><a href="example.php?id=1">bar</a></td><td>ref123</td></tr>',
$this->extractTableRow($this->table)
);
}
@@ -170,7 +170,7 @@ public function testLink1a(): void
);

static::assertSame(
'<tr data-id="1"><td><a href="example.php?id=1">bar</a></td><td>ref123</td></tr>',
'<tr data-id="1"><td class="atk4-norowclick"><a href="example.php?id=1">bar</a></td><td>ref123</td></tr>',
$this->extractTableRow($this->table)
);
}