Giter Club home page Giter Club logo

Comments (7)

bedeoverend avatar bedeoverend commented on June 6, 2024

Alternative to this would be changing how to handle images. Right now they're inserted into a p tag, but this causes problems anyway as a p tag's schema allows one or more inline elements inside it, which means it can insert an img inside it and then have text either side of it.

What might be better is having embed('image') actually insert a <figure><img/></figure> block, then ProseMirror can select the figure element which we can style as it's a top-level child (or rather, ask the element e.g. simpla-article to style it). This would also fix p being able to contain images and text.

from simpla-richtext-behavior.

madeleineostoja avatar madeleineostoja commented on June 6, 2024

You mean the blue outline when you focus on something?

outline: none;

Re: embeding, is there a reason we can't just insert a plain <img> on its own? Why does it have to be wrapped?

from simpla-richtext-behavior.

madeleineostoja avatar madeleineostoja commented on June 6, 2024

FWIW can't repro this, whatever it is.

By selecting an image do you mean dragging over it with highlight? That's normal behavior. Way to focus an image should be to tap it.

from simpla-richtext-behavior.

bedeoverend avatar bedeoverend commented on June 6, 2024

Yeah dragging over it with highlight. If you tap it, it won't focus on the img because it's not an input. ProseMirror handles it by actually 'highlighting' it when you tap on it i.e. simulating dragging over it. Then the 'img' is selected. It's actually a really nice solution because the img is actually highlighted. And it's a general behavior for any future embed.

Doesn't have to wrapped I don't think - I'm just using the default ProseMirror schema which means images get inserted inline inside p. But I can have a play with a custom schema and see how they play sitting by themselves.

from simpla-richtext-behavior.

bedeoverend avatar bedeoverend commented on June 6, 2024

Fixed in 3f73355, makes image top-level nodes so can be styled through ::slotted

from simpla-richtext-behavior.

madeleineostoja avatar madeleineostoja commented on June 6, 2024

FWIW tapping to focus worked for me /shrug

from simpla-richtext-behavior.

bedeoverend avatar bedeoverend commented on June 6, 2024

Sorry yeah so ProseMirror automatically handles taps / clicks and selects it, but the node itself isn't 'focused' as such, just highlighted / selected by ProseMirror. At least, I'm pretty sure that's how it worked

from simpla-richtext-behavior.

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.