Skip to content

Commit

Permalink
Merge pull request #999 from aehrc/issue/789
Browse files Browse the repository at this point in the history
Fix grid group not rendering properly without a parent item
  • Loading branch information
fongsean authored Sep 9, 2024
2 parents f249ca2 + 435f50d commit 8f3beaa
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import Box from '@mui/material/Box';
import { isRepeatItemAndNotCheckbox, isSpecificItemControl } from '../../utils';
import GroupTable from '../FormComponents/Tables/GroupTable';
import RepeatItem from '../FormComponents/RepeatItem/RepeatItem';
import GridGroup from '../FormComponents/GridGroup/GridGroup';

interface FormTopLevelItemProps
extends PropsWithQrItemChangeHandler,
Expand Down Expand Up @@ -128,6 +129,20 @@ function FormTopLevelItem(props: FormTopLevelItemProps) {

// If form is untabbed, it is rendered as a regular group
if (itemIsGroup) {
// Item is 'grid'
const itemIsGrid = isSpecificItemControl(topLevelQItem, 'grid');
if (itemIsGrid) {
return (
<GridGroup
qItem={topLevelQItem}
qrItem={topLevelQRItem}
groupCardElevation={1}
parentIsReadOnly={parentIsReadOnly}
onQrItemChange={onQrItemChange}
/>
);
}

// GroupTable "gtable" can be rendered with either repeats:true or false
if (isSpecificItemControl(topLevelQItem, 'gtable')) {
return (
Expand Down

0 comments on commit 8f3beaa

Please sign in to comment.