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

Wrong typings in CopyPaste plugin #6102

Closed
talamaska opened this issue Jul 11, 2019 · 4 comments
Closed

Wrong typings in CopyPaste plugin #6102

talamaska opened this issue Jul 11, 2019 · 4 comments

Comments

@talamaska
Copy link

Description

I'm breaking the process of pasting with a modal dialog if the columns of the copied data are more thant my table. If the users confirms, I slice the data, and I try to perform manual paste
I'm calling this.hotInstance.getPlugin('copyPase').paste(sliceddata)
the problem is that typescript is finding this

copy(triggeredByClick?: boolean): void;
cut(triggeredByClick?: boolean): void;
paste(triggeredByClick?: boolean): void;

while in the code of the plugin i clearly see this is not the case
https://github.com/handsontable/handsontable/blob/master/src/plugins/copyPaste/copyPaste.js#L184
cut()
and
https://github.com/handsontable/handsontable/blob/master/src/plugins/copyPaste/copyPaste.js#L274
paste(pastableText = '', pastableHtml = pastableText) {

I need some whay to do it manually.

Your environment

  • Handsontable version: 7.0.1
  • Browser Name and version: Chrome 69 electron 4.1.5
  • Operating System: Windows 10
@AMBudnik
Copy link
Contributor

Thank you for sharing, We'll check it out.

@AMBudnik
Copy link
Contributor

Sorry, for keeping you waiting, I'm not a TypeScript expert 🐤 but asked our devs for feedback and you're 100% right - we should change that.
Wouldn't it too much to ask for a pull request?

@talamaska
Copy link
Author

sure, there you go

@wojciechczerniak wojciechczerniak added this to the July 2019 milestone Jul 16, 2019
mrpiotr-dev pushed a commit that referenced this issue Sep 3, 2019
fix: typed parameters of paste method in copyPaste
fix: arguments for cut and copy, the js functions don't expect any params
@mrpiotr-dev mrpiotr-dev modified the milestones: July 2019, September 2019 Sep 3, 2019
AMBudnik added a commit that referenced this issue Oct 1, 2019
…6297)

* Filling definition for four hooks

Filling definition with optional options for
      afterCreateCol (source)
      afterCreateRow (source)
      afterRemoveCol (physicalColumns , source)
      afterRemoveRow (physicalColumns , source)

* Updated typings and JSDoc of CopyPaste (#6241)

* fix: #6102 Typings for copyPaste plugin methods (#6140)

fix: typed parameters of paste method in copyPaste
fix: arguments for cut and copy, the js functions don't expect any params

* Added: test specs for paste method. #6102

* Changed: JSDoc descriptions for the plugin and its definitions in typings file. #6102

* Replaced physicalColumns with physicalRows for afterRemoveRow and beforeRemoveRow callbacks in the settings.types.ts file.
@AMBudnik
Copy link
Contributor

@talamaska I'm happy to notify you that we've made a couple of improvements to the .ts file in the newest version 7.2.0 - published today.

Here's a full list of changes https://handsontable.com/docs/7.2.0/tutorial-release-notes.html

@AMBudnik AMBudnik reopened this Oct 15, 2019
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

4 participants