nanego / redmine_hide_sidebar

MIT License
22 stars 9 forks source link

Print view broken with overflowing container #7

Open menelaos opened 1 year ago

menelaos commented 1 year ago

This plugin in conjunction with redmine 5 causes some issues when printing pages that contain overflowing elements. In particular, it causes the left-hand side of the page to be cut off.

Steps to reproduce:

  1. Setup redmine according to https://redmine.org/projects/redmine/wiki/RedmineInstall
  2. Install redmine_hide_sidebar
  3. Start redmine
  4. Visit http://localhost:3000/projects
  5. Open DevTools and add the following element as a sibling to <h2>Projects</h2>:
    <div style="white-space: nowrap; width: 1800px; overflow-x: scroll;">
      Sed ut perspiciatis unde omnis iste natus error sit voluptatem
      accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae
      ab illo inventore veritatis et quasi architecto beatae vitae dicta
      sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit
      aspernatur aut odit aut fugit, sed quia consequuntur magni dolores eos
      qui ratione voluptatem sequi nesciunt. Neque porro quisquam est, qui
      dolorem ipsum quia dolor sit amet, consectetur, adipisci velit, sed
      quia non numquam eius modi tempora incidunt ut labore et dolore magnam
      aliquam quaerat voluptatem. Ut enim ad minima veniam, quis nostrum
      exercitationem ullam corporis suscipit laboriosam, nisi ut aliquid ex
      ea commodi consequatur? Quis autem vel eum iure reprehenderit qui in
      ea voluptate velit esse quam nihil molestiae consequatur, vel illum
      qui dolorem eum fugiat quo voluptas nulla pariatur?
    </div>
  6. Print page on A4
  7. See that the "Projects" header is not visible and the left side (beginning) of the page is cut off: Screenshot 2023-08-09 at 17 35 21

Possible fixes:

If I remove width: auto in https://github.com/nanego/redmine_hide_sidebar/blob/9b00777e783f759e8f2f23a084a53994b05997af/assets/stylesheets/redmine_hide_sidebar.css#L49 and https://github.com/nanego/redmine_hide_sidebar/blob/9b00777e783f759e8f2f23a084a53994b05997af/assets/stylesheets/redmine_hide_sidebar.css#L64, the page prints as expected: Screenshot 2023-08-09 at 17 49 12