Djphoenix719 / PDFoundry

A fully featured PDF viewer module for Foundry VTT, including form fillable actor sheets, journal links, and more!
Apache License 2.0
41 stars 20 forks source link

Dropdown state not saved upon closing Character Sheet PDF [BUG] #38

Closed Ithiloneth closed 4 years ago

Ithiloneth commented 4 years ago

Describe the bug When a dropdown list is used to set a value in a formfillable PDF for a character sheet the value does not remain once the sheet has been closed.

To Reproduce Steps to reproduce the behavior:

  1. Create a character sheet with a formfillable PDF
  2. Set a value in a dropdown list
  3. Close sheet
  4. Open sheet and find the value missing

Expected behavior I expected there to be a value in the are filled by the dropdown list.

Screenshots This image shows a dropdown list being used in the relevant sheet. image

Version Information:

P.S I was unable to attach any files as part of this post. Will attempt to reach you over Discord with a share. These files are the actor JSON and the formfillable PDF.

Djphoenix719 commented 4 years ago

Actor+Sheet.zip

Djphoenix719 commented 4 years ago

Alright so this is because of the way you have the select options in the PDF. For example, your field for "Favorite Subject" uses this for the list of options.


                       Charms
         Defence Against the Dark Arts
                      Herbology
                  History of Magic
                        Potions
                   Transfiguration
                             —
                     Arithmancy
                      Astronomy
            Care of Magical Creatures
                      Divination
                   Muggle Studies
                       Quidditch

The extra spaces at the front of the options above break this and handling the extra spaces would mean some foundational code changes that I'm not willing to do for what I perceive to be a pretty small cosmetic change. If you want your select options centered you can theoretically do it via CSS styling (using a custom viewer theme).

Changing your options to this (note there is a single line with a space at the front, and no empty line at the back):


Charms
Defence Against the Dark Arts
Herbology
History of Magic
Potions
Transfiguration
—
Arithmancy
Astronomy
Care of Magical Creatures
Divination
Muggle Studies
Quidditch

Fixes the issue.