Open ashu12chi opened 1 year ago
By any chance did you get a solution to this or any alternative?
This issue is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 7 days
Commenting as the issue is still pending.
We have this issue on other nodes as well, like using updateAttributes inside a table inside another table. Is there maybe any way to updateAttributes directly against a specific node, or a specific selection?
hmm, I just reported the same issue https://github.com/ueberdosis/tiptap/issues/4466
By any chance did you get a solution to this or any alternative? Is there maybe any way to updateAttributes directly against a specific node, or a specific selection?
@gethari @MetalArend I have put a workaround in this newly opened issue https://github.com/ueberdosis/tiptap/issues/4466
What’s the bug you are facing?
Hi,
I want to improve the ordered-list plugin to support different style-type for nested lists. I am doing this by adding
type
attribute on the ordered-list. I am doing it like this:The issue I am facing is when we call the sinkListItem command to nest the ordered list, I need to update the
type
separately. I am doing this by calling the updateAttributes() comand like this:When we nest a list using
sinkListItem
, the editor schema will add<ol><li><p></p></li></ol>
, which is a new ordered list and thus attribute of only this list should be updated but currently attribute of parent list is also getting updated due to which the outcome looks like:But I am expecting it to be:
I tried this same thing with the
start
attribute which is already defined in the ordered-list plugin, there alsoattributes
of all parent lists are getting updated which should not happen ideally. This is shown in the following GIF, where I am settingstart
of child list equal to 5 times of parent list butstart
of parent list is also getting updated.The alternative I considered here is to add
type
attribute on list-item which is not standard and thus I am not doing it. Another alternative is to use CSS to add list-style-type, using something like this:The issue with styling via CSS is
type
will not be exported as part of exported HTML, which is required for my use case. Additionally, when I copy content from an external source like MS Outlook, I want to parse thetype
attribute to have the exact same styling.Which browser was this experienced in? Are any special extensions installed?
In all browsers.
How can we reproduce the bug on our side?
Use this: https://codesandbox.io/s/solitary-voice-ubwslx?file=/src/App.js and follow the same steps as in attached GIF.
Can you provide a CodeSandbox?
https://codesandbox.io/s/solitary-voice-ubwslx?file=/src/App.js
What did you expect to happen?
Only attributes of the nested list should be updated.
Anything to add? (optional)
I am open to any alternate way to implement the same change. So, any suggestion or workaround is welcome.
Did you update your dependencies?
Are you sponsoring us?