vue-infinite-loading icon indicating copy to clipboard operation
vue-infinite-loading copied to clipboard

Issue for FireFox: getComputedStyle is null for iframe

Open vbabenko opened this issue 8 years ago • 6 comments

Version

@PeachScript, Could you please take a look on closed Pull request #74? Sorry for delay, I've provided answers on your questions. Is it possible to have fix in upcoming version?

Vue.js version

2.2.0

What is expected?

Add simple check that will not throw exception for getScrollParent method

What is actually happening?

When infinite-loading used in iFrame and for FireFox browser it throws expection Original FF issue https://bugzilla.mozilla.org/show_bug.cgi?id=548397

How to reproduce this problem?

I am using KeenUi Modal component that contains iframe with huge list of items. When page is rendered Modal component initialized and infiniteScrolling is triggered (but modal was not actualy opened). And in this situation infinite loading throws exception for FireFox browser due to their issue - getComputedStyle returns null for iframe

vbabenko avatar Sep 22 '17 14:09 vbabenko

For this problem, I think this solution cannot solve the real problem, because this component will find a error scroll wrapper if the real parent is a invisible iframe in the Firefox browser, it just prevent the error be thrown, the developers and users may don't understand why the program cannot work properly and there is no error, so I don't think it's a effective solution.

Perhaps we can control the component render through the v-if directive, we can render this component when the iframe is visible, how do you think about it?

PeachScript avatar Sep 24 '17 13:09 PeachScript

@PeachScript the problem here is that window.getComputedStyle returns null for FireFox inside iframe even when iframe is visible... So, v-if will not help, and there is no way to fix (just some UI work around for FF like a button where a user can click and load more). I do not know if possible to use something differ instead of window...

Let me double check how it behaves for opened iframe. I will post result soon

vbabenko avatar Sep 25 '17 15:09 vbabenko

I see, maybe the force-use-infinite-wrapper attribute can help you, details in here.

PeachScript avatar Sep 25 '17 15:09 PeachScript

Oh, I found that you were also one of the participants in that issue, is this way useless?

PeachScript avatar Sep 25 '17 15:09 PeachScript

I tested with v-if but the issue is reproducible. It throws exception TypeError: getComputedStyle(...) is null. So, no matter if content id hidden in iFrame or shown. I did not try force-use-infinite-wrapper attr yet. When I have result, I will post my status here

vbabenko avatar Sep 27 '17 14:09 vbabenko

@vbabenko got it, thanks!

PeachScript avatar Sep 28 '17 02:09 PeachScript