Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[8.0.0-svg] Selection on printed Handsontable #6626

Closed
aninde opened this issue Jan 10, 2020 · 7 comments
Closed

[8.0.0-svg] Selection on printed Handsontable #6626

aninde opened this issue Jan 10, 2020 · 7 comments
Assignees

Comments

@aninde
Copy link
Contributor

aninde commented Jan 10, 2020

Description

Found during testing #6467.

Selection does print without fillHandle.
Excel does not print selection.
@wojciechczerniak agreed it should not be visible on the print in Handsontable.
Screenshot 2020-01-08 at 14 09 31

Probably this bug occurs since the beginning but was hide on prints. Borders and selection were part of the background. Changes related to a new way of drawing SVG borders discover it.
This occur on every SVG PR
#6157
testing svg-stage1-#6157.pdf
#6593
testing svg-stage2-#6593.pdf
#6594
testing svg-stage2-#6594.pdf

Your environment

  • Handsontable version: 8.0.0-svg
  • Browser Name and version: any
  • Operating System: macOS Catalina, but shouldn't be related
@aninde aninde changed the title [8.0.0-svg] Selection of printed Handsontable [8.0.0-svg] Selection on printed Handsontable Jan 10, 2020
@warpech
Copy link
Member

warpech commented Jan 13, 2020

We discussed on Slack: https://handsoncode.slack.com/archives/C4PV4S33Q/p1578566904004800

The desicion made by @krzysztofspilka is to do a short-term solution to the problem which basically replicates the behavior of 7.x. That is: hide all SVG borders using CSS.

Unfortunately, this solution is against what was suggested here #5298 (comment), but I guess we will have to do it at least for now.

I think that the long-term solution will require specifying and implementing a new border setting printable, which custom borders would set to true and selections would set to false.

warpech added a commit that referenced this issue Jan 14, 2020
Prevent SVG borders from being rendered in print (including custom borders and selection borders). This commit implements the solution to #6626 described in the comment #6626 (comment).

In this commit, I have added an explicit CSS className to the SVG borders container, so that it becomes compatible with other SVG that may be rendered in the table.

In future, adding a new border setting (e.g. printable) would make it possible to render custom borders in print, while preventing selection borders from being printed.

Tested in print to PDF in Chrome, Edge, IE 11, IE 10 mode, IE 9 mode
@warpech
Copy link
Member

warpech commented Jan 14, 2020

Fixed according to the solution described above in the commit cd42f84, part of the PR #6157

@warpech warpech self-assigned this Jan 14, 2020
@aninde
Copy link
Contributor Author

aninde commented Jan 16, 2020

Ok, it works beautifully, according to the assumptions. No customBorders or selection can be seen on the print, but there is an empty space after square of fillHandle. This is regression, because it wasn't there on 7+ versions This square didn't belong to scope, but in my opinion it doesn't look good. What you think about it @wojciechczerniak ?

Print screen from browser
Screenshot 2020-01-16 at 11 38 22

Print screen from print
testing svg-stage3-#6157.pdf

Screenshot 2020-01-16 at 11 38 13

@wojciechczerniak
Copy link
Contributor

This square didn't belong to scope, but in my opinion it doesn't look good. What you think about it @wojciechczerniak ?

Looks like the fix in cd42f84 wasn't complete. This square is a part of fill handle which should be hidden in print as well.

@warpech
Copy link
Member

warpech commented Jan 16, 2020

Looks like the fix in cd42f84 wasn't complete. This square is a part of fill handle which should be hidden in print as well.

The fix was complete in that regard. As @aninde says, the empty hole insted of the fill handle is not a regression, because:

  • the same hole exists in 7.x
  • the hole is not rendered using SVG

I can make a fix for that in my branch, but I wanted to double confirm with you, because fixing the visual glitch that exists in 7.x is both a breaking change and not in scope of SVG borders. I hope that doesn't sound picky :)

@wojciechczerniak
Copy link
Contributor

Sorry, I thought I've read it wasn't there before.

I did a check myself in v7. It IS the fill handle. The web browser changed the background color to white. The default browser setting for "print background color" is no to limit ink waste.

You're right it's out of scope for this PR.

@aninde
Copy link
Contributor Author

aninde commented Jan 16, 2020

Thank you so much for double checking, the bug is actually on version 7+. Is reported https://github.com/handsontable/dev-handsontable/issues/352. So, IMO we should close this issue, cause fix in cd42f84 was complete and correct with assumptions and scope.

@aninde aninde closed this as completed Jan 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants