Giter Site home page Giter Site logo

Comments (11)

michael avatar michael commented on May 27, 2024

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.

obuchtala avatar obuchtala commented on May 27, 2024

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.

obuchtala avatar obuchtala commented on May 27, 2024

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.

michael avatar michael commented on May 27, 2024

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.

michael avatar michael commented on May 27, 2024

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.

obuchtala avatar obuchtala commented on May 27, 2024

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.

obuchtala avatar obuchtala commented on May 27, 2024

I am not saying that we bring that cursor in general. Just for this case.
Native cursor not possible, only for <img>

from substance.

obuchtala avatar obuchtala commented on May 27, 2024

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.

michael avatar michael commented on May 27, 2024

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.

obuchtala avatar obuchtala commented on May 27, 2024

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.

obuchtala avatar obuchtala commented on May 27, 2024

A totally different approach: allow for 'shifting' nodes via keyboard shortcut and drag.

from substance.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.