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

fix(svg): don't style width/height in attributes with unit #5550

Merged
merged 2 commits into from Mar 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 4 additions & 2 deletions examples/react-hooks/default-theme/src/components/Refresh.tsx
Expand Up @@ -13,10 +13,12 @@ export function Refresh() {
}}
>
<svg
width="1rem"
height="1rem"
fill="none"
viewBox="0 0 24 24"
style={{
width: '1rem',
height: '1rem',
}}
stroke="currentColor"
strokeWidth={2}
>
Expand Down
3 changes: 1 addition & 2 deletions packages/instantsearch.js/src/widgets/panel/panel.tsx
Expand Up @@ -265,8 +265,7 @@ const panel: PanelWidget = (panelWidgetParams) => {
collapseButtonText: ({ collapsed: isCollapsed }) =>
`<svg
class="${cssClasses.collapseIcon}"
width="1em"
height="1em"
style="width: 1em; height: 1em;"
viewBox="0 0 500 500"
>
<path d="${
Expand Down
3 changes: 1 addition & 2 deletions packages/vue-instantsearch/src/components/SearchInput.vue
Expand Up @@ -68,8 +68,7 @@
aria-hidden="true"
role="img"
xmlns="http://www.w3.org/2000/svg"
width="1em"
height="1em"
style="width: 1em; height: 1em"
dhayab marked this conversation as resolved.
Show resolved Hide resolved
viewBox="0 0 20 20"
:class="suit('resetIcon')"
>
Expand Down
Expand Up @@ -44,10 +44,9 @@ exports[`allows search bar classes override when it's searchable 1`] = `
>
<svg aria-hidden="true"
class="ais-SearchBox-resetIcon"
height="1em"
role="img"
style="width: 1em; height: 1em;"
viewbox="0 0 20 20"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z"
Expand Down Expand Up @@ -304,10 +303,9 @@ exports[`renders correctly when it's searchable 1`] = `
>
<svg aria-hidden="true"
class="ais-SearchBox-resetIcon"
height="1em"
role="img"
style="width: 1em; height: 1em;"
viewbox="0 0 20 20"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z"
Expand Down
Expand Up @@ -43,10 +43,9 @@ exports[`renders HTML correctly 1`] = `
>
<svg aria-hidden="true"
class="ais-SearchBox-resetIcon"
height="1em"
role="img"
style="width: 1em; height: 1em;"
viewbox="0 0 20 20"
width="1em"
xmlns="http://www.w3.org/2000/svg"
>
<path d="M8.114 10L.944 2.83 0 1.885 1.886 0l.943.943L10 8.113l7.17-7.17.944-.943L20 1.886l-.943.943-7.17 7.17 7.17 7.17.943.944L18.114 20l-.943-.943-7.17-7.17-7.17 7.17-.944.943L0 18.114l.943-.943L8.113 10z"
Expand Down
4 changes: 2 additions & 2 deletions specs/src/pages/widgets/panel.md
Expand Up @@ -16,7 +16,7 @@ althtml1: |
<div class="ais-Panel-header">
<span>Header</span>
<button class="ais-Panel-collapseButton" aria-expanded="true">
<svg class="ais-Panel-collapseIcon" width="1em" height="1em" viewBox="0 0 500 500">
<svg class="ais-Panel-collapseIcon" style="width: 1em; height: 1em" viewBox="0 0 500 500">
<path d="M250 400l150-300H100z" fill="currentColor" />
</svg>
</button>
Expand All @@ -30,7 +30,7 @@ althtml2: |
<div class="ais-Panel-header">
<span>Header</span>
<button class="ais-Panel-collapseButton" aria-expanded="false">
<svg class="ais-Panel-collapseIcon" width="1em" height="1em" viewBox="0 0 500 500">
<svg class="ais-Panel-collapseIcon" style="width: 1em; height: 1em" viewBox="0 0 500 500">
<path d="M100 250l300-150v300z" fill="currentColor" />
</svg>
</button>
Expand Down