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: iOS9以下svg引起的Modal展示问题 #3229

Merged
merged 2 commits into from Jun 12, 2019
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
2 changes: 1 addition & 1 deletion components/icon/loadSprite.tsx
Expand Up @@ -6,7 +6,7 @@ const svgSprite = (contents: string) => `
xmlns="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
id="__ANTD_MOBILE_SVG_SPRITE_NODE__"
style="position:absolute;width:0;height:0"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

出处应该是 https://github.com/JetBrains/svg-mixer/blob/master/packages/svg-mixer/runtime/src/sprite.config.js#L9

兼容性问题没啥好 review 的,这里本意只是想渲染但是不展示,表现不一致就得靠测了

style="display:none;overflow:hidden;width:0;height:0"
>
<defs>
${contents}
Expand Down
14 changes: 14 additions & 0 deletions components/modal/__tests__/__snapshots__/demo.test.js.snap
Expand Up @@ -67,9 +67,23 @@ exports[`renders ./components/modal/demo/basic.md correctly 1`] = `
class="am-button"
role="button"
>
<svg
class="am-icon am-icon-up am-icon-md"
>
<use
href="#up"
/>
</svg>
<span>
basic
</span>
<svg
class="am-icon am-icon-up am-icon-md"
>
<use
href="#up"
/>
</svg>
</a>
<div
class="am-whitespace am-whitespace-md"
Expand Down
4 changes: 2 additions & 2 deletions components/modal/demo/basic.md
Expand Up @@ -14,7 +14,7 @@ title:
Basic Modal.

````jsx
import { Modal, List, Button, WhiteSpace, WingBlank } from 'antd-mobile';
import { Modal, List, Button, WhiteSpace, WingBlank, Icon } from 'antd-mobile';

function closest(el, selector) {
const matchesSelector = el.matches || el.webkitMatchesSelector || el.mozMatchesSelector || el.msMatchesSelector;
Expand Down Expand Up @@ -61,7 +61,7 @@ class App extends React.Component {
render() {
return (
<WingBlank>
<Button onClick={this.showModal('modal1')}>basic</Button>
<Button onClick={this.showModal('modal1')}><Icon type="up" />basic<Icon type="up" /></Button>
<WhiteSpace />
<Modal
visible={this.state.modal1}
Expand Down