Comments (10)
Hey @zbeyens pls look into the PR that i opened regarding above bug
from plate.
I think this issue is caused by isCollapsed function which is using range.isCollapsed from slate
isCollapsed(range: Range): boolean {
const { anchor, focus } = range
return Point.equals(anchor, focus)
},
the problem is arising because our anchor and focus are equal but we have different offsets which is making isCollapsed false
from plate.
Yes, for the sake of reducing the complexity of the work, we haven't considered the expanded situation temporarily.
from plate.
@felixfeng33 can i create a PR for this fix by adding below function
const isCollapsedInternalFunction = (range?: Range | null) => {
// Early return for null or undefined range
if (!range ||!range.anchor ||!range.focus) {
return false;
}
// Destructure the anchor and focus properties for easier access
const { anchor, focus } = range;
const { anchor, focus } = range;
// Check if both anchor and focus exist and have the same path coordinates
if (anchor && focus && anchor.path.length > 0 && focus.path.length > 0) {
return anchor.path[0] === focus.path[0] && anchor.path[1] === focus.path[1];
}
};
from plate.
I think you can check the parent node props in the else statement.
from plate.
In your solution could I selection cross block?
from plate.
yes you can do cross selection in blocks as alignment is always block level
I have a question if a selection has first block center next block left what should be the overall alignment to be shown on top in mostly cases we show first block selection details can we do the same here
from plate.
It's better the overall alignment is none.
from plate.
I think we had better do some thing here since it's have more readability·
if (isCollapsed(editor.selection)) {
}else {
do some check here
}
from plate.
We should check the value of all selected blocks using getNodeEntries
, and return true only if every
block has the same value. One different value makes it false (like marks).
from plate.
Related Issues (20)
- Empty drop-down menu (Line Height Dropdown Menu)
- Pasting paragraph into list item clears the list item
- Blinking cursor when moving between table cells with ArrowDown or ArrowUp
- Z-Index of the navbar is too much. HOT 3
- Pasting HTML content into editor get weird style
- In playground template , when i use @udecode/plate-yjs,editor cannot render normally HOT 1
- HTML Serializer: `stripClassNames` removes legitimate content HOT 1
- Pasting a list with md doesnt work
- Serialize Markdown doesn't work with lists HOT 1
- Last editor ID is never set
- First heading has top margin it shouldn't have
- When LinkFloatingToolbar is open, FloatingToolbar loses its position when the page is scrolled HOT 1
- Assertion Type Missing HOT 1
- Website Bug: FixedToolBar Component hides the overflow of search Component in playground
- Press backspace on first paragraph (if empty) recreate a paragraph without node id
- Selecting everything in editor (cmd + a) and deleting
- Indent list todo creates an empty element when splitting an existing element
- insert column size is wrong when the table first row is merged
- exitBreakPlugin bug when `allow` is missing in config
- <PlateContent /> incorrectly forward ref to <Editable /> HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plate.