mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibGUI: Fix index invalidation
When the model gets updated, we have to let go of the old indexes, because they're invalid from that moment on. Fixes https://github.com/SerenityOS/serenity/issues/1541
This commit is contained in:
parent
3fcea71538
commit
7bd077a3ae
Notes:
sideshowbarker
2024-07-19 08:02:34 +09:00
Author: https://github.com/bugaevc Commit: https://github.com/SerenityOS/serenity/commit/7bd077a3ae0 Pull-request: https://github.com/SerenityOS/serenity/pull/1543
1 changed files with 4 additions and 2 deletions
|
@ -60,8 +60,10 @@ void AbstractView::set_model(RefPtr<Model> model)
|
|||
|
||||
void AbstractView::did_update_model()
|
||||
{
|
||||
if (!model() || selection().first() != m_edit_index)
|
||||
stop_editing();
|
||||
stop_editing();
|
||||
m_edit_index = {};
|
||||
m_hovered_index = {};
|
||||
selection().clear();
|
||||
}
|
||||
|
||||
void AbstractView::did_update_selection()
|
||||
|
|
Loading…
Reference in a new issue