joseluisq / printd

Print HTML elements or pages in modern browsers.
MIT License
80 stars 5 forks source link

Print selected value in select tag html #14

Closed JoaquinSerrano closed 4 years ago

JoaquinSerrano commented 4 years ago

Expected Behavior

A selected option of select html tag should be printed

Actual Behavior

By default, the printed version is showing the first option of select tag and not the selected option.

Steps to Reproduce the Problem

  1. Insert a select tag with multiple options
  2. Select the second, thirth, fourth... option, what you prefer
  3. When you print the page always the first option is showed

Workaround

...

Specifications

Web Version

Captura de pantalla 2020-05-28 a las 9 36 46

Printed Version

Captura de pantalla 2020-05-28 a las 9 37 57
joseluisq commented 4 years ago

Selected options on select HTML elements only work for option elements with the static selected attribute but not dynamic ones. You can take a look at https://codepen.io/joseluisq/pen/VzRpGb which is using v1.4.2.

You can solve it updating your dynamic selected option with the selected attribute too. Additionally here you have another workaround https://css-tricks.com/making-selects-printable/

I'm going to close this issue since it is not related to Printd.

JoaquinSerrano commented 4 years ago

Muchas gracias Jose Luis