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

added disableStyleCopyPaste property #5590

Merged
merged 4 commits into from
Apr 5, 2019

Conversation

melchiar
Copy link
Member

Added a new property disableStyleCopying to the text class, as discussed in #4981. Enabling this property essentially turns of the default Keep Source Formatting behavior of the existing copy paste functionality. Useful for applications where a single text style is desired for each text object.

@asturur, do you think we need any unit tests for this?

@asturur
Copy link
Member

asturur commented Mar 24, 2019

in test/unit/itext_key_behaviour.js line 266 we have a test for copy.
We can agument it ( or create a copy of it ) to test this new property.

@melchiar melchiar changed the title added disableStyleCopying property to text class added disableStyleCopyPaste property Mar 26, 2019
Copy link
Member Author

@melchiar melchiar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a property check here to prevent style pasting (in case text was copied before the property was changed). Is this an okay place to put it?

@asturur
Copy link
Member

asturur commented Apr 5, 2019

@melchiar i m merging this and adding a unit test for it.
I have been busy and i do not want drag you around for long.
Generally we want always to add one or more tests for the following reasons:

  1. future contribution may break this feature
  2. a test usually fix what is the intent of the code and in case of breakage explains you what you were expecting and how you should fix it.
  3. peoples/companies can trust libraries with tests more.

@asturur asturur merged commit 66037c7 into fabricjs:master Apr 5, 2019
@asturur asturur mentioned this pull request May 19, 2019
thiagocunha pushed a commit to thiagocunha/fabric.js that referenced this pull request Nov 18, 2019
@melchiar melchiar deleted the disableStyleCopying branch March 23, 2022 03:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants