wordpress-mobile / AztecEditor-Android

A reusable native Android rich text editor component.
Mozilla Public License 2.0
675 stars 112 forks source link

Cursor can not move to image start. #513

Closed liufsd closed 6 years ago

liufsd commented 6 years ago

hi~ when i insert a max width image . the Cursor can not move to this line end. image (can not move the cursor to the position after 'n')

how to fix this issue?

liufsd commented 6 years ago

and also can not select this line text before image. image

(build by last source code commit: 4106fce81395a9bf333cbc5fbb3c15767e6e3899)

0nko commented 6 years ago

This is a known issue and is related to #327.

daniloercoli commented 6 years ago

Fixed in #525

liufsd commented 6 years ago

sorry . not fixed. test: input "hello" and then, insert image you will see this issue again.

liufsd commented 6 years ago
    fun insertImage(drawable: Drawable?, attributes: Attributes, onImageTappedListener: OnImageTappedListener?,
                    onMediaDeletedListener: AztecText.OnMediaDeletedListener?) {
        val nestingLevel = IAztecNestable.getNestingLevelAt(editableText, selectionStart)
        val span = AztecImageSpan(editor.context, drawable, nestingLevel, AztecAttributes(attributes), onImageTappedListener,
                onMediaDeletedListener, editor)
        insertMedia(span)
    }

The 'nestingLevel' return 0. you can also test insert a image in some text. such as: input 'hello', and then insert a image before 'e'.

liufsd commented 6 years ago

Any answer about this ? i think, insert a image in the some text. we must insert a new line before image tag.