Skip to content

xlsform2lstsv: autocomplete dropdown is as wide as its longest option (page scrolls sideways on phones) #235

Closed

Description

@jstet

Since v0.11.0 (#226, #232), appearance=autocomplete emits question_theme_name=bootstrap_dropdown and show_search=true.

Problem

Verified on LimeSurvey 6.17.8 at a phone viewport of 390px. LimeSurvey's bootstrap_dropdown theme renders data-width='auto' while its width_entry attribute is unset or false. bootstrap-select then sizes the closed dropdown to the longest option. With a long list (12,243 municipality names) the button is 885px wide, and the whole page scrolls horizontally on phones.

Proposed fix

Emit width_entry=true as well (theme attribute: "width of dropdown = currently selected entry"). Measured with it set: the button is 176px wide with nothing selected and 366px with a long name selected.

  • Registry: the autocomplete appearance's lsQuestionTheme gets width_entry: true next to show_search.
  • width_entry is added to the known attribute columns.
  • Reverse path: TSVs made with 0.11.0 carry show_search=true but no width_entry. They must still read back as autocomplete, so width_entry is only emitted and not used to identify the appearance.

Known limit

The open menu is still as wide as the longest option. Fixing that needs theme CSS and is out of scope here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions