codex-team / codex-team/editor.js
Placing the block tunes location next to the block item instead of on the far left/right
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 32k
- Fork
- 2.2k
- Merge medio
- 1g 13h
- PR unite (30g)
- 2
Descrizione
Having float left/right for images is a common thing when writing an article. Most editors have this feature. However, most editors will display their toolbar directly above the block and leave it open so any changes to the block is still clickable. However, for editor.js, it will be on the far left/right which is not so obvious and when you float, becomes difficult to select the element.
I managed to create a workaround this issue by adding the following inside moveAndOpen function:
this.nodes.wrapper.style.left="".concat(Math.floor(((t.holder.querySelector('.ce-block__content').firstChild.offsetLeft > 0)?t.holder.querySelector('.ce-block__content').offsetLeft:0) + t.holder.querySelector('.ce-block__content').firstChild.offsetLeft),"px")
The element with ce-block__content class would need to have a z-index high enough to make it selectable. Float should be on the image block (Eg: simple-image)
However, this method does not take into account rtl
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia dalla funzione moveAndOpen e ispeziona come ce-block__content e il primo elemento figlio del blocco determinano la posizione del wrapper, incluso il caso di float di simple-image. Verifica che la toolbar rimanga selezionabile accanto al blocco sia nei layout da sinistra a destra sia in quelli da destra a sinistra, con il contenuto del blocco disposto nel livello appropriato.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- frontend
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 42/100