-
Notifications
You must be signed in to change notification settings - Fork 23
fix(Table): Fixes headless Table as previously it started to throw an error #648
Conversation
@@ -2233,7 +2233,7 @@ it('should handle table resize only when some columns were resized', () => { | |||
triggerResize = onResize; | |||
return [ | |||
jest.fn(), | |||
({ disconnect: jest.fn() } as unknown) as ResizeObserver, | |||
{ disconnect: jest.fn() } as unknown as ResizeObserver, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No idea why it made random formatter changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what have you done with your formatter :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nothing, I saw similar changes in Jon's PR. Our rules must have changed with monorepo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed or removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
idk, ask Mayank
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was because of multiple conflicting versions of prettier
. I've created #651 to fix it.
@bentleyvk Can you verify that it fixes the issue in your PR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I copied yarn.lock
, ran yarn install
and tried to format Table.tsx
but nothing happened, I also tried to commit the file but still it remain the same - with changed formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, had to refresh VS Code, now it formats. But strange why pre-commit hook didn't format...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can I just merge before waiting for prettier fix? Because there is a user that is waiting for my fixes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed and pushed the formatting in d6f33ee. Should be good to merge now.
isDisabled, | ||
...rest | ||
} = props; | ||
isDisabled; // To omit and prevent eslint error. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cant we omit this prop before it even reaches editable cell? Looks weird now..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh... thats weird..
Cant editable cell be disabled, afterall? :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then it would be just a default cell, doesn't make sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thats fine. Users would not need to switch between cells in their custom implementations.
They just pass all the props and be calm about it.
@@ -2233,7 +2233,7 @@ it('should handle table resize only when some columns were resized', () => { | |||
triggerResize = onResize; | |||
return [ | |||
jest.fn(), | |||
({ disconnect: jest.fn() } as unknown) as ResizeObserver, | |||
{ disconnect: jest.fn() } as unknown as ResizeObserver, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what have you done with your formatter :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I dont like the 'hack' on isDisabled
part, cause its kinda fooling the user now, but hopefully the original issue for headless table is fixed.
… error (iTwin/iTwinUI-react#648) Co-authored-by: Mayank <mayank99@users.noreply.github.com>
Closes #647
When user doesn't pass columns with root wrapping header, then error is thrown because it can't find any columns for
hasManualSelectionColumn
check.Also fixed an error where it would print to console that
isDisabled
is not a valid prop inEditableCell
.Checklist
Add component features demo in Storybook (different stories)Approve test images for new storiesAdd screenshots of the key elements of the component