mirror of
https://github.com/ueberdosis/tiptap.git
synced 2024-11-27 14:59:27 +08:00
fix(extension-table): correctly set min-width for table (#4684)
This commit is contained in:
parent
5283a51931
commit
c7f55500ee
5
.changeset/hungry-jokes-wash.md
Normal file
5
.changeset/hungry-jokes-wash.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"@tiptap/extension-table": patch
|
||||
---
|
||||
|
||||
Set correct `min-width` for a table fixes #5217
|
@ -63,7 +63,7 @@ context('/src/Nodes/Table/React/', () => {
|
||||
const html = editor.getHTML()
|
||||
|
||||
expect(html).to.equal(
|
||||
'<table style="minWidth: 25px"><colgroup><col></colgroup><tbody><tr><td colspan="1" rowspan="1"><p></p></td></tr></tbody></table>',
|
||||
'<table style="min-width: 25px"><colgroup><col></colgroup><tbody><tr><td colspan="1" rowspan="1"><p></p></td></tr></tbody></table>',
|
||||
)
|
||||
})
|
||||
})
|
||||
@ -75,7 +75,7 @@ context('/src/Nodes/Table/React/', () => {
|
||||
const html = editor.getHTML()
|
||||
|
||||
expect(html).to.equal(
|
||||
'<table style="minWidth: 25px"><colgroup><col></colgroup><tbody><tr><th colspan="1" rowspan="1"><p></p></th></tr></tbody></table>',
|
||||
'<table style="min-width: 25px"><colgroup><col></colgroup><tbody><tr><th colspan="1" rowspan="1"><p></p></th></tr></tbody></table>',
|
||||
)
|
||||
})
|
||||
})
|
||||
|
@ -62,7 +62,7 @@ context('/src/Nodes/Table/Vue/', () => {
|
||||
|
||||
const html = editor.getHTML()
|
||||
|
||||
expect(html).to.equal('<table style="minWidth: 25px"><colgroup><col></colgroup><tbody><tr><td colspan="1" rowspan="1"><p></p></td></tr></tbody></table>')
|
||||
expect(html).to.equal('<table style="min-width: 25px"><colgroup><col></colgroup><tbody><tr><td colspan="1" rowspan="1"><p></p></td></tr></tbody></table>')
|
||||
})
|
||||
})
|
||||
|
||||
@ -72,7 +72,7 @@ context('/src/Nodes/Table/Vue/', () => {
|
||||
|
||||
const html = editor.getHTML()
|
||||
|
||||
expect(html).to.equal('<table style="minWidth: 25px"><colgroup><col></colgroup><tbody><tr><th colspan="1" rowspan="1"><p></p></th></tr></tbody></table>')
|
||||
expect(html).to.equal('<table style="min-width: 25px"><colgroup><col></colgroup><tbody><tr><th colspan="1" rowspan="1"><p></p></th></tr></tbody></table>')
|
||||
})
|
||||
})
|
||||
|
||||
|
@ -286,7 +286,7 @@ export const Table = Node.create<TableOptions>({
|
||||
mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, {
|
||||
style: tableWidth
|
||||
? `width: ${tableWidth}`
|
||||
: `minWidth: ${tableMinWidth}`,
|
||||
: `min-width: ${tableMinWidth}`,
|
||||
}),
|
||||
colgroup,
|
||||
['tbody', 0],
|
||||
|
Loading…
Reference in New Issue
Block a user