New line / Line Break after added new image in the editor
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Reproduce the issue using the listed steps, then trace insertImage(_:), especially richTextView.replaceWithImage(at:sourceURL:placeHolderImage:) and the subsequent selection handling. Confirm that inserting an image leaves the cursor on the following line without requiring a keyboard return, while preserving the attachment and link behavior shown.
Written by the indexing model from the issue text.
Description
Describe the bug
Need to move the cursor to next line after i added image in the editor. Now, the cursor is right side of image.
Tried to add " \n and br tag " like below
func insertImage(_ image: UIImage) {
let attachment = richTextView.replaceWithImage(at: richTextView.selectedRange, sourceURL: fileURL!, placeHolderImage: image)
attachment.size = .full
attachment.alignment = ImageAttachment.Alignment.none
if let attachmentRange = richTextView.textStorage.ranges(forAttachment: attachment).first {
richTextView.setLink(fileURL!, inRange: attachmentRange)
}
richTextView.becomeFirstResponder()
// richTextView.text = richTextView.text + "\n"
// editorView.setHTML(editorView.getHTML()+"</p>\n<p>")
let imageID = attachment.identifier
let progress = Progress(parent: nil, userInfo: [MediaProgressKey.mediaID: imageID])
progress.totalUnitCount = 100
}
// editorView.setHTML(editorView.getHTML()+"</p>\n<p>")
// richTextView.text = richTextView.text + "\n"
Nothing worked.
To Reproduce
Steps to reproduce the behavior:
- Type some text
- Click + button to open image picker, choose image
- Image added in editor but the cursor in right side of image
- Need to press return button in the keyboard to make the cursor to come next line. But, how i can make it programmatically to move next line
Expected behavior
Need to press return button in the keyboard to make the cursor to come next line. But, how i can make it programmatically to move next line
Smartphone (please complete the following information):
- Device: iOS
- Dominant language
- Swift
- Stars
- 669
- Forks
- 153
- Avg merge
- 11h 27m
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from wordpress-mobile/AztecEditor-iOS
-
Bug
Difficulty 3/5 1-2 days Newbie friendliness 45/100
wordpress-mobile/AztecEditor-iOS#1417 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
wordpress-mobile/AztecEditor-iOS#1411 ·
-
wordpress-mobile/AztecEditor-iOS#1401 · 2 comments · 1 assignee ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
wordpress-mobile/AztecEditor-iOS#1399 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
wordpress-mobile/AztecEditor-iOS#1398 · 1 comment · 1 reaction ·
All issues in wordpress-mobile/AztecEditor-iOS
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
type: docs
Difficulty 1/5 Under an hour Newbie friendliness 95/100
googleapis/google-cloud-swift#971 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bitcoindevkit/bdk-ffi#1125 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
mozilla-mobile/firefox-ios#35743 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
manaflow-ai/cmux#13417 ·