yuku / textcomplete

Autocomplete for HTMLTextAreaElement and more.
https://yuku.takahashi.coffee/textcomplete/
MIT License
1.74k stars 305 forks source link

Option for specifying a dynamic width #329

Closed dopatraman closed 4 years ago

dopatraman commented 4 years ago

Goal: The goal of this PR is to provide users with an option to specify that their UI features a dynamic width.

Reason for change: The application I am building expands the width of the document element dynamically. As a result, the anchor point of the dropdown stays at the window width's edge instead of expanding rightward.

Since the clientWidth of the document is computed initially and never again, it isn't ideal for applications whose UI expands. Instead, scrollWidth works better. This PR adds an option for specifying a need for this value.