-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Report: print doesn't cut off expanded audit details #1870
Merged
Merged
Conversation
This file contains 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
ebidel
suggested changes
Mar 21, 2017
window.addEventListener('afterprint', _ => { | ||
details.map(detail => detail.open = false); | ||
}); | ||
} else { | ||
// Note: while FF has media listeners, it doesn't fire when matching 'print'. | ||
window.matchMedia('print').addListener(mql => { | ||
details.map(detail => detail.open = mql.matches); | ||
if(!mql.matches) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spacing: if (!mql.matches) {
Tried this and it looks great! Just the one style comment. |
ebidel
changed the title
solve page truncated including short cut
Report: print doesn't cut off expandde audit details
Mar 21, 2017
zixu-zhao
force-pushed
the
fix/pageTruncated
branch
from
March 21, 2017 22:18
d656b3c
to
c81994d
Compare
Hi, I updated the style of |
ebidel
approved these changes
Mar 21, 2017
ebidel
changed the title
Report: print doesn't cut off expandde audit details
Report: print doesn't cut off expanded audit details
Mar 21, 2017
ebidel
pushed a commit
that referenced
this pull request
Mar 28, 2017
ebidel
added a commit
that referenced
this pull request
Mar 29, 2017
* Report: add legend to decipher iconography left to us by the ancient ones (#1841) * Report: print doesn't cut off expanded audit details (#1870) * Report: increase icon size for a11y (#1856) * Tweak report colors so that we are WCAG2AA valid. * Biggin icons * CLI: add update-notifier. Fixes #1805 (#1890) * Fixes #1907 - move update-notifier to root (#1908) * CLI: remove npm prepublish (#1889)
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.
Hi,
I apologize I mess up the git tree of the previous brunch. I just delete the older pull request and brunch, and create a new one. This one would be clear. I also improve the code to support shortcut expanding.
Thanks,
Zixu Zhao
Original request message:
did some researches of the issue: Print ->Save as PDF : Pages truncated #1780, and here is my solution.
The main problem I found is, once the
window.print()
is called. The printing process will take current page height immediately. In fact, the function _setupExpandDetailsWhenPrinting works as expected in my tests, i.e. all details are labeledopen=true
when triggeringprint
event.So the only problem is, for example, the page height is 2112px before the expanding, and the printing take it as 3 pages pdf file; however, after the expanding, the page height is 9230px, and it requires 11 pages pdf file. Then, the last 8 pages are truncated in this case.
I found two possibilities.
First, I could solve it by adding a
min-height: 10000px
under the@media print
. It is obviously a bad idea. However, it works, so it confirms my hypophysis above.Second, since my searching work implies that there is no way to change the page height dynamically in CSS or after
window.print()
is called, I would like to solve the problem through calling expand before callingwindow.print()
. I left the collapse listener for the event when printing complete.Closes #1780