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

Column header with blue outline after clicking for sorting #685

Closed
oim5nu opened this issue Dec 14, 2017 · 11 comments
Closed

Column header with blue outline after clicking for sorting #685

oim5nu opened this issue Dec 14, 2017 · 11 comments
Assignees
Labels
critical Issues or bugs that are highly critical and must be solved as soon as possible.

Comments

@oim5nu
Copy link

oim5nu commented Dec 14, 2017

What version of React-Table are you using?

Your bug may already be fixed in the latest release. Run yarn upgrade react-table!
6.7.5

What bug are you experiencing, or what feature are you proposing?

As described in Title.
Refer to description by @gary-menzel in #682

Use https://codesandbox.io/s/X6npLXPRW (by clicking the "Fork" button) to reproduce the issue.

https://codesandbox.io/s/5knzrn8qmk

What are the steps to reproduce the issue?

  1. npm install -g create-react-app
  2. Add 'react-table@6.7.5' to package.json.
  3. replace src/App.js with following code
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import ReactTable from 'react-table';
import 'react-table/react-table.css';

class App extends Component {
  constructor() {
    super();
  }
  render() {
    const data = [
            {
                "location":"01-01",
                "amount":150
            },
            {
                "location":"01-02",
                "amount":3000
            },
            {
                "location":"01-03",
                "amount":1201
            }
    ];

    const columns = [
      {
        Header: "Location",
        accessor: "location"
      },
      {
        Header: "Amount",
        accessor: "amount",
        Cell: props => <span className='number'>{props.value}</span>
      }
    ];

    return (
      <div className="App">
        <header className="App-header">
          <img src={logo} className="App-logo" alt="logo" />
          <h1 className="App-title">Welcome to React</h1>
        </header>
        <p className="App-intro">
          To get started, edit <code>src/App.js</code> and save to reload.
        </p>
        <ReactTable
          data={data}
          columns={columns}
          classsName='-striped -highlight'
        />
      </div>
    );
  }
}

export default App;
  1. npm start.
  2. Click any title of headers, and it shows

image

@gary-menzel
Copy link
Contributor

Thanks for that - checking in some changes against this issue now. Not sure how quickly it will make it into a release (but I have notified the owner).

gary-menzel added a commit to Raisemetrex/react-table that referenced this issue Dec 14, 2017
@gary-menzel gary-menzel self-assigned this Dec 14, 2017
@gary-menzel gary-menzel added critical Issues or bugs that are highly critical and must be solved as soon as possible. Priority:High labels Dec 14, 2017
@caub
Copy link

caub commented Dec 19, 2017

Yes noticed it too, the outline also wraps the column-resizer so it looks weird

I think the outline is fine, just fixing the boundaries will be good (by moving resize handles out of focusable header buttons)

@gary-menzel
Copy link
Contributor

The focus issue is a bug that has a PR in waiting to get released.

@maccuaa
Copy link
Contributor

maccuaa commented Mar 28, 2018

I've recently started using React Table and noticed that this bug is still occurring. Using the Code Sandbox link referenced above (https://codesandbox.io/s/5knzrn8qmk) I updated the react-table dependency to 6.8.0 and the blue outline is still there.

I've create a PR with a fix (see #881)

@gary-menzel
Copy link
Contributor

Please see my comment on the PR.

@alexpreynolds
Copy link

alexpreynolds commented Apr 12, 2018

One thing that works for me is using the onSortedChange property, overriding it to blur the document's active element.

<ReactTable
    ...
    onSortedChange={(c, s) => { document.activeElement.blur() }}
    ...
    />

The blue outline flickers so it isn't eliminated completely, but at least it doesn't hang around and be a distracting nuisance for people who do not need to track focus.

Hope this helps others!

@Jefski14
Copy link

Jefski14 commented May 8, 2018

Any news on that PR? I still have the Issue in 6.8.2

@mikkel-vagn
Copy link

Add this to your CSS:

.ReactTable .rt-thead [role="columnheader"] {
outline: 0;
}

@cedricholz
Copy link

I updated react-table which didn't work and I couldn't figure out how to add Mikkel-Vagn's css in without hardcoding it into the module files. This works for me though.

getTheadThProps={() => { return { style: { outline: 0, } }; }}

@claidler
Copy link

claidler commented Nov 5, 2018

Following on from @cedricholz comment, incase this is of any use to anyone - I had grouped table headers, so used the getTheadGroupThProps function also:

getTheadThProps={() => { return { style: { outline: 0, } }; }}
getTheadGroupThProps = {() => { return { style: { outline: 0, } }; }}

@dukekosy
Copy link

.ReactTable .rt-resizer{ display:inline-block; position:absolute; width:3px; top:0; bottom:0; right:-1px; cursor:col-resize; z-index:10 }
did the trick. it reduces the size of the table column resizer.

aarudenko99 pushed a commit to aarudenko99/react-datagrid that referenced this issue Mar 26, 2020
aarudenko99 pushed a commit to aarudenko99/react-datagrid that referenced this issue Mar 26, 2020
opensource521 pushed a commit to opensource521/react-table-maker that referenced this issue Apr 10, 2020
zach393 pushed a commit to zach393/reactTable that referenced this issue Dec 11, 2020
Cheetah0723 added a commit to Cheetah0723/Table that referenced this issue Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
critical Issues or bugs that are highly critical and must be solved as soon as possible.
Projects
None yet
Development

No branches or pull requests

10 participants