Skip to content

Commit

Permalink
Update TableView with multi inline actions (#5118)
Browse files Browse the repository at this point in the history
* Allowing TableView to pass max_inline_actions as an arg

Co-authored-by: minhtuevo <minhtuev@voxel51.com>
  • Loading branch information
minhtuev and minhtuevo authored Nov 15, 2024
1 parent e1e0a81 commit 572d669
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const DEFAULT_MAX_INLINE = 1;
export default function ActionsMenu(props: ActionsPropsType) {
const { actions, maxInline = DEFAULT_MAX_INLINE, size } = props;

if (actions.length === maxInline) {
if (actions.length <= maxInline) {
return (
<Stack direction="row" spacing={0.5} justifyContent="flex-end">
{actions.map((action) => (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default function TableView(props: ViewPropsType) {
selected_color,
size = "small",
variant = "filled",
max_inline_actions = 1,
} = view;
const { rows, selectedCells, selectedRows, selectedColumns } =
getTableData(props);
Expand Down Expand Up @@ -198,6 +199,7 @@ export default function TableView(props: ViewPropsType) {
<ActionsMenu
actions={getRowActions(rowIndex)}
size={size}
maxInline={max_inline_actions}
/>
)}
</TableCell>
Expand Down

0 comments on commit 572d669

Please sign in to comment.