1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 10:08:10 +00:00

TextEditor: Adjust AutoCompleteBox's position to the scroll height

This commit is contained in:
Itamar 2021-03-27 18:04:51 +03:00 committed by Andreas Kling
parent e64a42dd50
commit f6cc382403

View file

@ -1315,7 +1315,7 @@ void TextEditor::try_show_autocomplete()
m_autocomplete_provider->provide_completions([&](auto completions) {
auto has_completions = !completions.is_empty();
m_autocomplete_box->update_suggestions(move(completions));
auto position = content_rect_for_position(cursor()).bottom_right().translated(screen_relative_rect().top_left().translated(ruler_width(), 0).translated(10, 5));
auto position = content_rect_for_position(cursor()).translated(0, -visible_content_rect().y()).bottom_right().translated(screen_relative_rect().top_left().translated(ruler_width(), 0).translated(10, 5));
if (has_completions)
m_autocomplete_box->show(position);
});