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

[7.1.0+]Can't paste from Excel #6217

Closed
Esorakouki opened this issue Aug 20, 2019 · 6 comments
Closed

[7.1.0+]Can't paste from Excel #6217

Esorakouki opened this issue Aug 20, 2019 · 6 comments

Comments

@Esorakouki
Copy link

@Esorakouki Esorakouki commented Aug 20, 2019

Description

In 7.1.0+, when i paste data from Excel, the following error will occur.

image

It's ok in Versions below 7.1.0.

Steps to reproduce

sorry, i can't reproduce this error in browsers, only in safari in Sketch app.

Demo

Your environment

  • Handsontable version: 7.1.1
  • Browser Name and version: safari in Sketch
  • Operating System: Mac OS 10.14.5
@AMBudnik

This comment has been minimized.

Copy link
Contributor

@AMBudnik AMBudnik commented Aug 20, 2019

I am sorry but I wasn't able to replicate the issue. It seems to be related to your implementation.
Handsontable doesn't throw this error message.

@Esorakouki

This comment has been minimized.

Copy link
Author

@Esorakouki Esorakouki commented Aug 21, 2019

@AMBudnik the error is on this piece of code (get the CSSRules from the Excel content).
image

There is a CSSPageRule which has an unmatchable selectorText "@page".
image

I think it's a special Safari version in Sketch.

@wojciechczerniak

This comment has been minimized.

Copy link
Member

@wojciechczerniak wojciechczerniak commented Aug 21, 2019

In Firefox:
Screenshot 2019-08-21 at 11 30 31

Same would happen in FF if there would be @page selectorText, which is not a selector but looks like one. We haven't encounter @page rule before in copied clipboard.

We should check if the cssRule has supported type or is the instance of CSSStyleRule, not CSSPageRule:

if (cssRule.selectorText && matchCSSRules(cell, cssRule.selectorText)) {

Might be a good idea to check remaining types as well.

Edit: Note from @swistach, we should use CSSRule.STYLE_RULE, reference: https://developer.mozilla.org/en-US/docs/Web/API/CSSRule . We should check if IE9 supports the type property first.

@wojciechczerniak wojciechczerniak added this to the September 2019 milestone Aug 21, 2019
@swistach swistach modified the milestones: September 2019, October 2019 Oct 30, 2019
swistach added a commit that referenced this issue Oct 30, 2019
swistach added a commit that referenced this issue Oct 31, 2019
swistach added a commit that referenced this issue Oct 31, 2019
swistach added a commit that referenced this issue Nov 4, 2019
…ettings (#6409)

* Changed: matchesCSSRule helper is moved into dom.element helpers. #6217

* Added: test for matchesCSSRules. #6217

* Added: typings and its tests. #6217
jansiegel added a commit that referenced this issue Nov 8, 2019
…ettings (#6409)

* Changed: matchesCSSRule helper is moved into dom.element helpers. #6217

* Added: test for matchesCSSRules. #6217

* Added: typings and its tests. #6217
@aninde

This comment has been minimized.

Copy link

@aninde aninde commented Nov 15, 2019

This issue should be fixed by 7.3.0 - I tested change in code locally #6409 (comment)

I would like to test is on original reproduction, using Sketch with WebView founded by @swistach to be 100% sure, but I need some time to prepare the testing environment.

@aninde

This comment has been minimized.

Copy link

@aninde aninde commented Dec 9, 2019

Tested locally latest build of 7.3.0 v. (6.12) - still fixed.

@AMBudnik

This comment has been minimized.

Copy link
Contributor

@AMBudnik AMBudnik commented Dec 13, 2019

Hey @Esorakouki

we're finally here with the official fix. Please update to 7.3.0 and let me know if it fixes the issue in your application as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.