Skip to content

Commit

Permalink
Merge pull request #2674 from nwmac/fix-table-select
Browse files Browse the repository at this point in the history
Fix table selection no longer showing
  • Loading branch information
vincent99 committed Apr 13, 2021
2 parents 926eed4 + a45bc86 commit 819565e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions components/SortableTable/selection.js
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,16 @@ export default {
const id = get(node, keyField);

if ( id ) {
const input = $(`label[data-node-id="${ id }"]`);
// Note: This is looking for the checkbox control for the row
const input = $(`div[data-checkbox-ctrl][data-node-id="${ id }"]`);

if ( input && input.length && !input[0].disabled ) {
// can't reuse the input ref here because the table has rerenderd and the ref is no longer good
$(`label[data-node-id="${ id }"]`).prop('value', on);
const label = $(input[0]).find('label');

let tr = $(`label[data-node-id="${ id }"]`).closest('tr');
if (label) {
label.prop('value', on);
}
let tr = input.closest('tr');
let first = true;

while ( tr && (first || tr.hasClass('sub-row') ) ) {
Expand Down
2 changes: 1 addition & 1 deletion components/form/Checkbox.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default {
</script>

<template>
<div class="checkbox-outer-container">
<div class="checkbox-outer-container" data-checkbox-ctrl>
<label
class="checkbox-container"
:class="{ 'disabled': isDisabled}"
Expand Down

0 comments on commit 819565e

Please sign in to comment.