Repository navigation
Write a select without a size as a combo box (#396) - #419
Merged
Merged
Conversation
An active select got the combo box flag only when it carried a size below two, but Tag\Select keeps the size only when it is above one, so every select was written as a list box. HTML draws a select as a drop-down unless it is multiple or given two or more rows, and the flags now follow that rule. A bare multiple attribute was read as an empty string and so ignored; its presence now makes the select multi-select. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…combo boxes Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Sep 23, 2026
Disable a select given a bare disabled attribute
This was referenced Sep 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
With
useActiveForms, every<select>was written as a list box.Form::print_ob_select()set the Combo flag only whensizewas set and below 2, butTag\Selectkeepssizeonly when it is above 1. So evensize="1"never got the flag.What changed
Form::print_ob_select()now follows HTML. A select is a combo box unless it ismultipleor has a size of two or more rows. Amultipleselect is always a multi-select list box, whatever its size.Tag\Selectreadsmultipleas true whenever it is present, the wayInputandTextAreatreat their boolean attributes. Before this, a baremultipleparsed to'',empty()treated it as absent, and<select multiple>lost its MultiSelect flag. That was true even withsize="3".The static (non-active) rendering does not depend on the combo decision and is unchanged. Row height still comes from
sizealone, so<select multiple>with no size stays one row tall. HTML draws four rows there, but changing that would change the layout of existing documents./Ffbitssize="1"size="4"multiple,multiple size="3"editableeditable spellcheck="true"editable spellcheck="true" size="4"Verification
tests/Mpdf/SelectFieldFlagsTest.phprenders each of the cases above and decodes the field's/Ff. Before the fix, seven of the nine cases failed.page-break-avoid-formssnapshot is refreshed in its own commit. The only change in it is/Ff 4194304→/Ff 4325376on its two selects, which is the Combo bit, and its pages rasterise the same.composer testpasses: 3422 tests, 5 skipped. The snapshot group passes, and so docomposer csand PHPStan.Interaction with #387
#387 draws combo boxes and list boxes differently, and plain selects will now take its combo-box path. I cherry-picked this fix onto
fix/348-pdfa-active-formsand rendered selects with pdftoppm and Ghostscript. They were a plain select, one with no selected option, one at 20pt,size="3", and a baremultiple. In both renderers each combo box shows a single line with the selected option (or the first option when none is selected). The text is vertically centred and nothing below it is clipped. The one-rowmultiplelist box shows only its highlighted option.Fixes #396
🤖 Generated with Claude Code