[Bug]: colwidth is not working with editable as false #4044
Labels
Category: Open Source
The issue or pull reuqest is related to the open source packages of Tiptap.
Triage: Open
A new issue or pullrequest that requires triage (added by default)
Type: Bug
The issue or pullrequest is related to a bug
Which packages did you experience the bug in?
extension-table
What Tiptap version are you using?
2.0.3
What’s the bug you are facing?
When the editor is used with
editable: false
, thecolwidth
property ontable-header
is not working. The below image shows two editors, the first is editable and the second is read-only. In the first editor, the width of first column is respected but in the second editor, the width of first column is minimal to the width of content.What browser are you using?
Chrome
Code example
https://codesandbox.io/s/affectionate-sea-2zln6e?file=/src/App.js
What did you expect to happen?
In both the cases,
colwidth
should be respected.Anything to add? (optional)
On my further investigation in the issue, I found when
resizable
is set to false in the Table extension, thecolwidth
will not work for editable mode of editor also. As per this, when editor is set to be non-editable, theresizable
is always false. As per this, I understand why this done and it is a desired behavior for me too.The display of column-width is handled here, which will work only when resizable is used, which is not always desired.
The current workaround I am using to solve this issue is to pass
handleWidth
as zero for making table non-resizable in read-only mode but still make surecolwidth
is respected. (For Original code - ref)Did you update your dependencies?
Are you sponsoring us?
The text was updated successfully, but these errors were encountered: