[ios] fix EditorVC NoteCell jumping while typing

Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
Kiryl Kaveryn
2025-06-18 21:28:26 +04:00
committed by Konstantin Pastbin
parent de7f60ea37
commit 87cb0307cf

View File

@@ -901,13 +901,12 @@ void registerCellsForTableView(std::vector<MWMEditorCellID> const & cells, UITab
{ {
self.offscreenCells[(id<NSCopying>)cellClass(MWMEditorCellTypeNote)] = cell; self.offscreenCells[(id<NSCopying>)cellClass(MWMEditorCellTypeNote)] = cell;
self.note = text; self.note = text;
dispatch_async(dispatch_get_main_queue(), ^{
[UIView setAnimationsEnabled:NO]; [UIView setAnimationsEnabled:NO];
[self.tableView refresh]; [self.tableView refresh];
[self.tableView layoutIfNeeded];
[UIView setAnimationsEnabled:YES]; [UIView setAnimationsEnabled:YES];
NSIndexPath * ip = [self.tableView indexPathForCell:cell]; });
[self.tableView scrollToRowAtIndexPath:ip
atScrollPosition:UITableViewScrollPositionBottom
animated:YES];
} }
- (void)cell:(MWMNoteCell *)cell didFinishEditingWithText:(NSString *)text { self.note = text; } - (void)cell:(MWMNoteCell *)cell didFinishEditingWithText:(NSString *)text { self.note = text; }