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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Table): apply props.style to container div #18494

Merged
merged 2 commits into from Aug 27, 2019
Merged

Conversation

paranoidjk
Copy link
Contributor

@paranoidjk paranoidjk commented Aug 27, 2019

馃 This is a ...

  • New feature
  • Bug fix
  • Site / document update
  • Component style update
  • TypeScript definition update
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

馃敆 Related issue link

caused by #18330

Reproduciable demo:

import { Table, Divider, Tag } from 'antd';

const columns = [
  {
    title: 'Name',
    dataIndex: 'name',
    key: 'name',
    render: text => <a>{text}</a>,
  },
  {
    title: 'Age',
    dataIndex: 'age',
    key: 'age',
  },
  {
    title: 'Address',
    dataIndex: 'address',
    key: 'address',
  },
  {
    title: 'Tags',
    key: 'tags',
    dataIndex: 'tags',
    render: tags => (
      <span>
        {tags.map(tag => {
          let color = tag.length > 5 ? 'geekblue' : 'green';
          if (tag === 'loser') {
            color = 'volcano';
          }
          return (
            <Tag color={color} key={tag}>
              {tag.toUpperCase()}
            </Tag>
          );
        })}
      </span>
    ),
  },
  {
    title: 'Action',
    key: 'action',
    render: (text, record) => (
      <span>
        <a>Invite {record.name}</a>
        <Divider type="vertical" />
        <a>Delete</a>
      </span>
    ),
  },
];

const data = [
  {
    key: '1',
    name: 'John Brown',
    age: 32,
    address: 'New York No. 1 Lake Park',
    tags: ['nice', 'developer'],
  },
  {
    key: '2',
    name: 'Jim Green',
    age: 42,
    address: 'London No. 1 Lake Park',
    tags: ['loser'],
  },
  {
    key: '3',
    name: 'Joe Black',
    age: 32,
    address: 'Sidney No. 1 Lake Park',
    tags: ['cool', 'teacher'],
  },
];

ReactDOM.render(
  (<div style={{ display: 'flex', border: '1px solid green', width: 200 }}>
    <Table columns={columns} dataSource={data} style={{ width: '100%', border: '1px solid red' }}/>
    </div>
   ), mountNode);

馃挕 Background and solution

馃摑 Changelog

Language Changelog
馃嚭馃嚫 English
馃嚚馃嚦 Chinese

鈽戯笍 Self Check before Merge

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • TypeScript definition is updated/provided or not needed
  • Changelog is provided or not needed

@netlify
Copy link

netlify bot commented Aug 27, 2019

Deploy preview for ant-design ready!

Built with commit a47e8f9

https://deploy-preview-18494--ant-design.netlify.com

@afc163
Copy link
Member

afc163 commented Aug 27, 2019

ci broken

@paranoidjk
Copy link
Contributor Author

paranoidjk commented Aug 27, 2019

Updated, CI passed now.

@afc163 afc163 merged commit f3244d6 into master Aug 27, 2019
20 of 21 checks passed
@afc163 afc163 deleted the fix-table-props-style branch Aug 27, 2019
@afc163 afc163 mentioned this pull request Aug 27, 2019
14 tasks
@codecov
Copy link

codecov bot commented Aug 27, 2019

Codecov Report

Merging #18494 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #18494      +/-   ##
==========================================
+ Coverage   96.41%   96.41%   +<.01%     
==========================================
  Files         280      280              
  Lines        7523     7524       +1     
  Branches     2090     2090              
==========================================
+ Hits         7253     7254       +1     
  Misses        268      268              
  Partials        2        2
Impacted Files Coverage 螖
components/table/Table.tsx 93.8% <100%> (+0.01%) 猬嗭笍

Continue to review full report at Codecov.

Legend - Click here to learn more
螖 = absolute <relative> (impact), 酶 = not affected, ? = missing data
Powered by Codecov. Last update 817f3c2...a47e8f9. Read the comment docs.

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

Successfully merging this pull request may close these issues.

None yet

2 participants