Skip to content

fix(lstsv): autocomplete dropdown width follows the selected entry - #236

Merged
jstet merged 1 commit into
mainfrom
fix/dropdown-width
Nov 4, 2026
Merged

jstet merged 1 commit into
mainfrom
fix/dropdown-width

Conversation

@jstet

@jstet jstet commented Nov 4, 2026

Copy link
Copy Markdown
Member

Fixes #235.

LimeSurvey's bootstrap_dropdown theme renders data-width='auto' while width_entry is unset, so the closed autocomplete dropdown is as wide as the longest option (885px for 12,243 municipality names; the page scrolls sideways on phones). appearance=autocomplete now also emits width_entry=true: the button is 176px unselected and 366px with a long name selected (LimeSurvey 6.17.8, 390px viewport). The open menu is still as wide as the longest option; that needs theme CSS and is out of scope.

Reverse path: the registry's lsQuestionTheme gets an emitOnlyAttributes map next to attributes. Both are written to the TSV, but only attributes (show_search) identify the appearance in themedAppearanceOf. TSVs made with 0.11.0 have no width_entry and still read back as autocomplete. width_entry is also added to ATTRIBUTE_COLUMNS; src/generated is regenerated with uv run codegen.

Before:

question_theme_name	show_search
bootstrap_dropdown	true

After:

question_theme_name	show_search	width_entry
bootstrap_dropdown	true	true

Tests

  • Unit: autocomplete emits width_entry=true; a 0.11.0-style TSV without width_entry reads back as autocomplete.
  • Live test tests/live/limesurvey/test_lstsv_attributes.py also asserts width_entry == "true" (not run, needs the LimeSurvey docker setup).
  • npm test: 108 files and 1766 tests pass. npm run validate is clean.

🤖 Generated with Claude Code

…idth_entry)

Fixes #235.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@jstet
jstet merged commit bdba092 into main Nov 4, 2026
4 checks passed
@jstet
jstet deleted the fix/dropdown-width branch November 4, 2026 19:39
@jstet jstet mentioned this pull request Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant