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

Code for SVGElement.attr missing trailing "$" in regex test when handling named symbols #6463

matt-hoskins opened this issue Mar 14, 2017 · 1 comment


Copy link

@matt-hoskins matt-hoskins commented Mar 14, 2017

Expected behaviour

E.g. set rotation attribute on a named symbol SVGElement to a value and have that attribute change be processed.

Actual behaviour

Value is discarded because the attribute begins with the letter 'r' and the regex in question (line 485 in master SvgRender.js) is missing a trailing $:

                                if (this.symbolName && /^(x|y|width|height|r|start|end|innerR|anchorX|anchorY)/.test(key)) {
					if (!hasSetSymbolSize) {
						hasSetSymbolSize = true;
					skipAttr = true;

So the "r" part of the pattern would match a key of e.g. "rotation" and set skipAttr to true as there's no "$". symbolAttr will only process the attributes specifically named in the list in the regex so the attribute setting of rotation doesn't happen.

I would guess it's an accident that the trailing "$" isn't there rather than by design.

Copy link

@TorsteinHonsi TorsteinHonsi commented Mar 15, 2017

Thanks, that's a good catch! Yes I assume you're right about this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.