question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Dialog fitViewport doesn't work in pf 10.0.0

See original GitHub issue

Describe the defect dialog.js function fitViewport, please change the row this.content.css('max-height', String(maxHeight)); to this.content.css('max-height', maxHeight);. String constant for max-height without units doesn’t work in jquery 3.5.1 which is used in PF 10.0.0. In jquery 3.6.0 it works fine.

Environment:

  • PF Version: 10.0.0

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
mellowarecommented, Mar 19, 2021

@vonnai can you try this and verify it works… Just add this script to your application.

if (PrimeFaces.widget.Dialog) {
    PrimeFaces.widget.Dialog.prototype.fitViewport = function() {
        var windowHeight = $(window).height();
        var margin = this.jq.outerHeight(true) - this.jq.outerHeight();
        var headerHeight = this.titlebar.outerHeight(true);
        var contentPadding = this.content.innerHeight() - this.content.height();
        var footerHeight = this.footer.outerHeight(true) || 0;
        var maxHeight = windowHeight - (margin + headerHeight + contentPadding + footerHeight);
        this.content.css('max-height', maxHeight + 'px');
    }
}
0reactions
VsevolodGolovanovcommented, Sep 29, 2021

Not sure why you’re scripting at all here. Could just style smth like max-height: calc(100vh - 50px);. This should work even in IE9. I’d remove the fitViewport option and just have it like this by default. Then if someone really needs an overflowing dialog they could just override max-height by styling.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Viewport is not visible and cannot be selected or adjusted in ...
On the Quick Select dialog box, set the Object type to Viewport and click OK. If other viewports are in the layout tab,...
Read more >
Configuring the Viewport - Apple Developer
Configuring the Viewport. Safari on iOS displays webpages at a scale that works for most web content originally designed for the desktop.
Read more >
Polymer paper-dialog - set size to full viewport in shady dom ...
I am trouble making paper-dialog take the full viewport. As shown in the image, I can't seem to force it. I have tried...
Read more >
Getting Started with EnSight 10.2
EN-GS:10.0-0. January 2012 ... Open the Reset Tools and Viewports dialog that permits ... Fits the currently visible model in the currently selected....
Read more >
PDFlib-10.0.0-tutorial.pdf
3.3.2 Password-Protecting PDF Documents with PDFlib 73. 3.4 XMP Metadata 76 ... NET Framework project with Visual Studio (this method doesn't work.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found