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

在Drawer里的Collapse嵌入Table组件文字溢出 #17040

Closed
1 task
jason5149 opened this issue Jun 11, 2019 · 4 comments
Closed
1 task

在Drawer里的Collapse嵌入Table组件文字溢出 #17040

jason5149 opened this issue Jun 11, 2019 · 4 comments
Assignees

Comments

@jason5149
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

import React, { Component } from "react";
import ReactDOM from "react-dom";
import { Collapse, Row, Table, Drawer, Button } from "antd";

import "./styles.css";

const { Panel } = Collapse;

class App extends Component {
  state = {
    visible: false
  };

  render() {
    const { visible } = this.state;
    const columns = [
      { key: "id", dataIndex: "id", title: "id" },
      { key: "name", dataIndex: "name", title: "name" }
    ];
    const dataSource = [
      {
        id: 1,
        name: "Jason"
      },
      {
        id: 2,
        name:
          "JasonJasonJasonJasonJasonJasonJasonJasonJasonJasonJasonJasonJasonJasonJasonJason"
      }
    ];

    return (
      <div className="App">
        <Button
          type="primary"
          onClick={() => {
            this.setState({
              visible: !visible
            });
          }}
        >
          Toggle
        </Button>
        <Drawer
          title="Span"
          width={250}
          closable
          placement="left"
          visible={visible}
          onClose={() => {
            this.setState({
              visible: false
            });
          }}
        >
          <Collapse>
            <Panel header="Basic" key="basic">
              <Row span={24}>
                <Table
                  size="small"
                  rowKey="id"
                  columns={columns}
                  pagination={false}
                  dataSource={dataSource}
                />
              </Row>
            </Panel>
          </Collapse>
        </Drawer>
      </div>
    );
  }
}

const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);

What is expected?

溢出文字自动换行

What is actually happening?

溢出文字没有自动换行

Environment Info
antd 3.19.3
React 16.8.6
System Mac OS 10.14.5
Browser Chrome
@afc163
Copy link
Member

afc163 commented Jun 11, 2019

@afc163 afc163 closed this as completed Jun 11, 2019
@zombieJ
Copy link
Member

zombieJ commented Jun 11, 2019

自行添加样式 or 设置一个 scroll 属性:https://codesandbox.io/s/crimson-haze-28jw0

@jason5149
Copy link
Author

自行添加样式 or 设置一个 scroll 属性:https://codesandbox.io/s/crimson-haze-28jw0

为什么单独使用不会有溢出的问题?

@zombieJ
Copy link
Member

zombieJ commented Jun 11, 2019

一样会顶出去的,没做过特殊处理:
屏幕快照 2019-06-11 下午12 32 49

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

3 participants