Konva warning: [object Undefined] is a not valid value for "crop" attribute
See original GitHub issueDespite it’s declaration: crop?: IRect;
, Image’s crop
can’t handle an undefined
value.
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Konva warning: NaN is a not valid value for "radius" · Issue #726
I have "Konva warning: NaN is a not valid value for "radius" attribute. The value should be a number." warning while create a...
Read more >How to resize and rotate canvas shapes with react and konva?
Type 'MutableRefObject<transformer |="" undefined="">' is not assignable to type 'string | ((instance: Transformer | null) => void) | RefObject<transformer> | ...
Read more >Class: Image - Konva
The fillPriority property makes it really easy to toggle between different fill ... get crop var crop = image.crop(); // set crop image.crop({...
Read more >Class: Node - Konva
create node with JSON string or an Object. De-serializtion does not generate custom shape drawing functions, images, or event handlers (this would make...
Read more >Class: Layer - Konva
clearBeforeDraw, Boolean, <optional>. set this property to false if you don't want to clear the canvas before each layer draw. The default value...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just pushed a little fix to konva for that case.
I ran into a variant of this, when transitioning an image component from having a crop to no longer having a crop. Essentially the following:
I didn’t set an
undefined
crop in my code, but this line would cause that to happen regardless: https://github.com/konvajs/react-konva/blob/950925060d5fd9cca748f570f8edc9f5f3cbfb91/src/makeUpdates.ts#L79I can work around this by setting the four crop attributes individually (or alternatively, instead of removing the crop, using a no-op crop with the full image dimensions), but figured it was worth reporting