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

SVG Attribute heights #50

Closed
genericmilk opened this issue May 2, 2018 · 4 comments
Closed

SVG Attribute heights #50

genericmilk opened this issue May 2, 2018 · 4 comments

Comments

@genericmilk
Copy link

Hi there!

Love Bounty, It's fantastic, I do have a small issue though that I hope you can help with?

I'm trying to run an instance of Bounty in a h1 with position absolute but everytime I run it it kicks out such errors as:

Error: <svg> attribute height: A negative value is not valid. ("-20")

And by kick out I mean a lot of errors!

I'm trying to run it as follows but it won't initialise. I have bounty elsewhere running fine so I'm wondering if it's to do with the size and positioning of the target element? (Do I need to put it in a child)?

bounty.default({
					el: 'h1.Raised',
					value: '£123,456.00',
					lineHeight: 0,
				});

Thanks!

@coderitual
Copy link
Owner

Hi @genericmilk! It's hard to say without any example provided. Bounty takes all computed styles from the element where it is placed (also there shouldn't be any other element inside to avoid overrides). First thing I would check is the lineHeight you have set to 0. Try some big number to test whether is it somehow related. Also if you could extract problematic instance and put it online (on codepen, jsbin etc) I could help you debug it.

@genericmilk
Copy link
Author

Hi @coderitual Thanks so much for getting back to me! The lineheight ended up being the problem, Set it to 1 and it cleared it up.

Thanks for your help again!

@coderitual
Copy link
Owner

That's cool, I think I should validate options more carefully and provide the user with more comprehensive message in case of error, thanks!

I would also love to see your usage of the library somewhere online!

@genericmilk
Copy link
Author

Yeah that's a great idea, It would really help for those who encounter it :)

I'm building it into a charity fundraiser website that raises money for several charities over a live event, It's a great plugin for showing a change in money raised.

Many thanks for your help again!

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

No branches or pull requests

2 participants