Background color context element does not have position values
See original GitHub issueReproduction: https://codesandbox.io/s/chart-js-gradient-annotations-broken-8pf3z
It seems that on the first draw, ctx.element
does not have x
, x2
, y
nor y2
, making it impossible to draw gradients.
These values are only missing on the first draw; You can uncomment line 52 and see that on the first draw green
is returned, but after clicking “Force update”, the actual gradient works.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
background-position - CSS: Cascading Style Sheets | MDN
The background-position CSS property sets the initial position for each background image. The position is relative to the position layer set ...
Read more >4 reasons your z-index isn't working (and how to fix it)
Check that the elements have their position set and z-index numbers in the correct order. Make sure that you don't have parent elements...
Read more >Why does z-index not work? - Stack Overflow
The z-index property only works on elements with a position value other than static (e.g. position: absolute; , position: relative; , or position:...
Read more >14 Colors and Backgrounds - W3C
14.2.1 Background properties: 'background-color', 'background-image', 'background-repeat', 'background-attachment', 'background-position', and 'background'.
Read more >Z-index and stacking contexts - web.dev
my-element now has a position value that's not static and a z-index value that's not auto , it has created a new stacking...
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
I have already this working in a branch, but will need find the reason for the original change so we don’t break anything.
@kurkle if you agree, I’m gonna try to do it tomorrow (if you don’t want to do it yourself and if I’ll have time, in this period I’ve got many other stuff to do)