Skip to content

Commit

Permalink
Merge pull request #51 from GeekTree0101/feature/VEditorKit-User-cann…
Browse files Browse the repository at this point in the history
…ot-remove-last-textNode

[Bug] User cannot remove last text node
  • Loading branch information
GeekTree0101 authored Feb 11, 2019
2 parents 74900a6 + 389e026 commit 33bfd75
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion VEditorKit/Classes/VEditorNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -847,7 +847,9 @@ extension VEditorNode {

private func deleteUnnecessaryEditableTextIfNeeds(with: UITableView.RowAnimation = .automatic) {
guard let indexPath = self.activeTextIndexPath,
self.editorContents.count > 1 else { return }
self.editorContents.count > 1,
indexPath.row != self.editorContents.count - 1 else { return }

self.resignActiveTextNode()
self.editorContents.remove(at: indexPath.row)
self.tableNode.deleteRows(at: [indexPath], with: with)
Expand Down

0 comments on commit 33bfd75

Please sign in to comment.