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

Enhance the SvgRegistry.registerIconFromSvg() method to support the icon- prefix #6813

Closed
RomanTsukanov opened this issue Aug 28, 2023 · 0 comments · Fixed by #6947
Closed
Assignees
Milestone

Comments

@RomanTsukanov
Copy link
Contributor

Our icon API is inconsistent: to replace an icon with a built-in icon, you need the icon- prefix:

import { settings } from "survey-core";
settings.customIcons["icon-import"] = "icon-export";
settings.customIcons["icon-export"] = "icon-import";'

But to replace an icon with a custom icon, no prefix is needed:

const svg = '<svg viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">...</svg>';
SvgRegistry.registerIconFromSvg("v2check", svg);

Suggestion: the registerIconFromSvg() method should support the icon- prefix.

novikov82 added a commit that referenced this issue Sep 12, 2023
novikov82 added a commit that referenced this issue Sep 15, 2023
…rt the `icon-` prefix - fixed test

Fixes #6813
tsv2013 pushed a commit that referenced this issue Sep 15, 2023
…rt the `icon-` prefix (#6947)

* #6813 Enhance the `SvgRegistry.registerIconFromSvg()` method to support the `icon-` prefix
Fixes #6813

* #6813 Enhance the `SvgRegistry.registerIconFromSvg()` method to support the `icon-` prefix - fixed test
Fixes #6813
@OlgaLarina OlgaLarina added this to the v1.9.108 milestone Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants