Skip to content

Commit

Permalink
fix: corrected toggle calls for Superscript and Subscript
Browse files Browse the repository at this point in the history
  • Loading branch information
hamza-hadj-aissa committed Jul 31, 2024
1 parent 81c0bc7 commit a3d7b91
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
5 changes: 5 additions & 0 deletions apps/www/content/docs/components/changelog.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Use the [CLI](https://platejs.org/docs/components/cli) to install the latest ver

## July 2024 #12

### July 30 #12.3

- **MoreDropdownMenu**: Fixed the toggling behavior for Superscript and Subscript marks.

### July 14 #12.2

- fix `cursor`: Show selection rect/caret if cursor data is undefined.
Expand Down Expand Up @@ -132,6 +136,7 @@ export const TableElement = withHOC(
- import `withProps` from `@udecode/cn` instead of `@udecode/plate-common
`

- all components using `forwardRef` are now using `withRef`. `withProps`, `withCn` and `withVariants` are also used to reduce boilerplate.
- add `withCn` to ESLint `settings.tailwindcss.callees` and `classAttributes` in your IDE settings

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export function PlaygroundMoreDropdownMenu(props: DropdownMenuProps) {
<DropdownMenuItem
onSelect={() => {
toggleMark(editor, {
clear: MARK_SUBSCRIPT,
clear: [MARK_SUBSCRIPT, MARK_SUPERSCRIPT],
key: MARK_SUPERSCRIPT,
});
focusEditor(editor);
Expand All @@ -80,7 +80,7 @@ export function PlaygroundMoreDropdownMenu(props: DropdownMenuProps) {
<DropdownMenuItem
onSelect={() => {
toggleMark(editor, {
clear: MARK_SUPERSCRIPT,
clear: [MARK_SUPERSCRIPT, MARK_SUBSCRIPT],
key: MARK_SUBSCRIPT,
});
focusEditor(editor);
Expand Down
8 changes: 4 additions & 4 deletions apps/www/src/registry/default/plate-ui/more-dropdown-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ export function MoreDropdownMenu(props: DropdownMenuProps) {
<DropdownMenuItem
onSelect={() => {
toggleMark(editor, {
clear: MARK_SUPERSCRIPT,
key: MARK_SUBSCRIPT,
clear: [MARK_SUBSCRIPT, MARK_SUPERSCRIPT],
key: MARK_SUPERSCRIPT,
});
focusEditor(editor);
}}
Expand All @@ -48,8 +48,8 @@ export function MoreDropdownMenu(props: DropdownMenuProps) {
<DropdownMenuItem
onSelect={() => {
toggleMark(editor, {
clear: MARK_SUBSCRIPT,
key: MARK_SUPERSCRIPT,
clear: [MARK_SUPERSCRIPT, MARK_SUBSCRIPT],
key: MARK_SUBSCRIPT,
});
focusEditor(editor);
}}
Expand Down
2 changes: 1 addition & 1 deletion packages/selection/src/queries/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
*/

export * from './getSelectedBlocks';
export * from "./isNodeBlockSelected";
export * from './isNodeBlockSelected';
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ export function MoreDropdownMenu(props: DropdownMenuProps) {
<DropdownMenuItem
onSelect={() => {
toggleMark(editor, {
key: MARK_SUBSCRIPT,
clear: MARK_SUPERSCRIPT,
clear: [MARK_SUBSCRIPT, MARK_SUPERSCRIPT],
key: MARK_SUPERSCRIPT,
});
focusEditor(editor);
}}
Expand All @@ -46,8 +46,8 @@ export function MoreDropdownMenu(props: DropdownMenuProps) {
<DropdownMenuItem
onSelect={() => {
toggleMark(editor, {
key: MARK_SUPERSCRIPT,
clear: MARK_SUBSCRIPT,
clear: [MARK_SUPERSCRIPT, MARK_SUBSCRIPT],
key: MARK_SUBSCRIPT,
});
focusEditor(editor);
}}
Expand Down

0 comments on commit a3d7b91

Please sign in to comment.