Skip to content

Commit

Permalink
fix: toggleList with validLiChildrenTypes (#1816)
Browse files Browse the repository at this point in the history
* fix

* fix

* Create spotty-hotels-happen.md
  • Loading branch information
zbeyens authored Aug 24, 2022
1 parent 943c9c6 commit cbf00c0
Show file tree
Hide file tree
Showing 8 changed files with 289 additions and 81 deletions.
5 changes: 5 additions & 0 deletions .changeset/spotty-hotels-happen.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@udecode/plate-list": patch
---

Fixes #1817
2 changes: 1 addition & 1 deletion examples/apps/next/src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default function MyApp({ Component, pageProps }: any) {
<div className="app">
<Sidebar />

<div style={{ width: '100%' }}>
<div style={{ width: '100%', overflow: 'scroll' }}>
<DndProvider backend={HTML5Backend}>
<Component key={router.asPath} {...pageProps} />
</DndProvider>
Expand Down
4 changes: 4 additions & 0 deletions examples/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ td {

.slate-HeadingToolbar {
padding: 17px 60px !important;
position: fixed !important;
background: white !important;
z-index: 1000;
width: 100%;
}

.tippy-box[data-theme~='tomato'] {
Expand Down
4 changes: 2 additions & 2 deletions packages/nodes/list/src/onKeyDownList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
import isHotkey from 'is-hotkey';
import { castArray } from 'lodash';
import { Range } from 'slate';
import { ELEMENT_LIC } from './createListPlugin';
import { ELEMENT_LI } from './createListPlugin';
import { moveListItems, toggleList } from './transforms';
import { ListPlugin } from './types';

Expand Down Expand Up @@ -53,7 +53,7 @@ export const onKeyDownList = <

// check if we're in a list context.
const listSelected = someNode(editor, {
match: { type: getPluginType(editor, ELEMENT_LIC) },
match: { type: getPluginType(editor, ELEMENT_LI) },
});

if (workRange && listSelected) {
Expand Down
Loading

1 comment on commit cbf00c0

@vercel
Copy link

@vercel vercel bot commented on cbf00c0 Aug 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

plate – ./

plate.udecode.io
plate-udecode.vercel.app
www.plate.udecode.io
plate-git-main-udecode.vercel.app

Please sign in to comment.