Skip to content

create insert array if one doesn't exist while moving table #4925

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ A `secondaryLevel: true` option is available to add operations to the widget's c
### Fixes

* Fixes all eslint warnings.
* Fixes a RT bug where including `table` in `toolbar` but omitting an `insert` array crashed the rich text editor.

## 4.15.0 (2025-04-16)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -283,9 +283,12 @@ export default {
// no configuration needed. If:
// 1. The table is configured for the toolbar but not insert, move it
// 2. remove the table tool from the toolbar
if (activeOptions.toolbar.some(tool => tool === 'table')) {
if (!activeOptions.insert.some(tool => tool === 'table')) {
activeOptions.insert.push('table');
if (activeOptions.toolbar?.some(tool => tool === 'table')) {
if (!activeOptions.insert?.some(tool => tool === 'table')) {
activeOptions.insert = [
...(activeOptions.insert || []),
'table'
];
}
activeOptions.toolbar = activeOptions.toolbar.filter(tool => tool !== 'table');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
class="apos-context-menu__item"
:class="menuItem.separator ? 'apos-context-menu__item--separator' : null"
>
<hr v-if="menuItem.separator" class="apos-context-menu__separator" />
<hr
v-if="menuItem.separator"
class="apos-context-menu__separator"
>
<button
v-else
class="apos-context-menu__button"
Expand Down