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

AST trows a warning for a button with theme with states #15178

Closed
KacperMadej opened this issue Feb 18, 2021 · 2 comments · Fixed by #15182 or #17157
Closed

AST trows a warning for a button with theme with states #15178

KacperMadej opened this issue Feb 18, 2021 · 2 comments · Fixed by #15182 or #17157

Comments

@KacperMadej
Copy link
Contributor

Behaviour

If states are used in buttonTheme I get a warning in the console:
Highcharts warning: Invalid attribute 'states' in config

Live demo with steps to reproduce

https://jsfiddle.net/gh/get/library/pure/highcharts/highcharts/tree/master/samples/stock/rangeselector/styling/

or

https://api.highcharts.com/highcharts/chart.resetZoomButton.theme
Steps: zoom to show the button -> warning

Product version

v9.0.0+

Workaround

Ignore it - everything works fine anyway.

Internal notes

states end up in normalState (from the theme), but could be safely deleted before running AST.filterUserAttributes(normalState) because normalState is already a copy and states are provided to SVGRenderer.prototype.button as arguments and later used from them

@drmrbrewer
Copy link

@TorsteinHonsi @KacperMadej @DJTechnoo I'm seeing this warning in HC 10.0.0... seems to have re-appeared?

Steps to reproduce:

BTW is it possible to add a top padding for the button text (or a negative bottom padding)? I'm finding that the text is sitting a little high in the button:

image

@TorsteinHonsi
Copy link
Collaborator

Thanks! The fix for this issue only fixed range selector and map navigation buttons. So we should probably dig a bit deeper to try to cover all kinds of buttons.

Regarding offsetting the text, there is currently no API option for it, but CSS transform seems to work fine: https://jsfiddle.net/highcharts/eLkfz40w/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment