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

Color changes when mouse hover on disabled link component in table cell #9218

Closed
2 tasks done
shizy818 opened this issue Jul 18, 2021 · 0 comments · Fixed by #9395
Closed
2 tasks done

Color changes when mouse hover on disabled link component in table cell #9218

shizy818 opened this issue Jul 18, 2021 · 0 comments · Fixed by #9395
Assignees
Labels
component: link severity: 3 User can complete task, and/or has a workaround type: bug 🐛

Comments

@shizy818
Copy link

What package(s) are you using?

  • carbon-components 10.39.0
  • carbon-components-react 10.39.0

Detailed description

Describe in detail the issue you're having.

The behavior of disabled link component itself is as expected. However when I have a disabled link in table cell, the color changes when the mouse hovers on it. It is because of following css:
图片

What did you expect to happen? What happened instead? What would you like to
see changed?

I expect disabled link in the table cell does not have this behavior. Any workaround now?

What browser are you working in?

Firefox

Steps to reproduce the issue

  1. https://codesandbox.io/s/github/carbon-design-system/carbon/tree/main/packages/react/examples/codesandbox
  2. Paste following Code in index.js
import React from 'react';
import { render } from 'react-dom';
import { DataTable, Link, Table, TableContainer, 
  TableHead, TableHeader, TableRow, TableBody, TableCell } from 'carbon-components-react';

const headerData = [
  {
    header: 'Name',
    key: 'name',
  },
];
const rowData = [
  {
    id: 'a',
    name: 'Load Balancer 3',
  },
  {
    id: 'b',
    name: 'Load Balancer 1',
  },
];
const App = () => (
  <DataTable rows={rowData} headers={headerData}>
  {({ rows, headers, getHeaderProps, getTableProps }) => (
    <TableContainer title="DataTable">
      <Table {...getTableProps()}>
        <TableHead>
          <TableRow>
            {headers.map((header) => (
              <TableHeader {...getHeaderProps({ header })}>
                {header.header}
              </TableHeader>
            ))}
          </TableRow>
        </TableHead>
        <TableBody>
          {rows.map((row) => (
            <TableRow key={row.id}>
              {row.cells.map((cell) => (
                <TableCell key={cell.id}>
                  <Link href="#" disabled>{cell.value}</Link>
                </TableCell>
              ))}
            </TableRow>
          ))}
        </TableBody>
      </Table>
    </TableContainer>
  )}
</DataTable>
);

render(<App />, document.getElementById('root'));

Additional information

  • Screenshots or code
  • Notes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: link severity: 3 User can complete task, and/or has a workaround type: bug 🐛
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants