Comments (11)
I think the most natural solution would be to add a fake-text element (e.g. paragraph) before the IN (sth that exists only in the view not in the model). Then the user can navigate there with the cursor. Once they start typing we actually create the paragraph in the model.
Not sure how the inverse should look like, when the user wants to get rid of that text before the IN again. Probably it's ok to leave the paragraph there until removed with cmd+backspace. We could also react once this first paragraph becomes empty and delete it from the model (and again leave it in the view).
from substance.
This is unfortunately very inconsistent with respect to the selection, which is visible to the model.
So, I would say not down this route.
from substance.
We already have a flag on NodeSelection: 'before'
So the model could already deal with this.
Only visually we have no means to show this to the user.
from substance.
And if we just prevent that from ever happening. I mean if we disable insertion of isolated nodes as first element in a container?
from substance.
I didn't like the custom cursor style we had before... somewhat unnatural. But if we managed to do it with a native blinking cursor I think it would be fine.
from substance.
There are a bunch of ways how to run into this situation. Particularly if it comes to collab at some time.
No, we need to deal with it on a UI level
from substance.
I am not saying that we bring that cursor in general. Just for this case.
Native cursor not possible, only for <img>
from substance.
You could go even further and render some more complex element in the top of the IN when sel.type is 'node' and sel.mode is 'before'
from substance.
Understand.
Mhh.. native cursor also not possible if we would be ok that it's rendered at a lower height (like a text cursor) at the top-left of the IN?
from substance.
I see two alternatives (assuming that we have the mentioned special node selection) :
- either a 'blinking line' (like you suggested)
- or a bold div in the top of the IN that tells the user to ENTER or click to create a new paragraph
Then the question how to 'activate' this type of selection: maybe the user could press UP on the first IN. (but then there would be no other clue before)
Alternatively we 'interpret' node selections on the first node as 'node::before' and then do one of the two visuals.
from substance.
A totally different approach: allow for 'shifting' nodes via keyboard shortcut and drag.
from substance.
Related Issues (20)
- Found a case where XMLDocumentNode.find() does not find a direct child HOT 1
- [question] The best practice for loading an asynchronous document into an editor
- Asciidoc backend? HOT 1
- A selection should not be allowed to point to a non existing surface HOT 1
- Edit inline node is not working for nodes which goes one after another HOT 4
- Why does substance depend on substance? HOT 2
- [Feature Request] Allow substance components to return components as their root? HOT 12
- ES5 support? HOT 4
- Plans to an import-HTML module?
- Error in "isDisabled" function in InsertInlineNodeCommand class
- Importing references without doi HOT 1
- CDATA Text elements makes schema invalid HOT 1
- DOM.parseSnippet() provides two elements when content is CDATA
- Clicking on InlineNode inside of IsolatedNode selects the IsolatedNode HOT 1
- Strange DOM selection after click
- Draggable InlineNodes have a strange selection in Chrome HOT 1
- JS-YAML Error HOT 1
- npm start does not work as described in README.md HOT 2
- Is substance.io died? HOT 1
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 substance.