question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Background color context element does not have position values

See original GitHub issue

Reproduction: 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:closed
  • Created 2 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
kurklecommented, Jan 18, 2022

I have already this working in a branch, but will need find the reason for the original change so we don’t break anything.

0reactions
stockiNailcommented, Jan 18, 2022

we should stop resolving the properties beforehand and just pass the resolver as options.

@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)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found