From 3fcb30bdacd133fc7c5a11d512a4cbedd43fd933 Mon Sep 17 00:00:00 2001 From: Steffen Vogel <post@steffenvogel.de> Date: Fri, 19 Jul 2019 09:35:49 +0200 Subject: [PATCH] fix invalid href warnings for anchor elements --- src/components/editable-header.js | 8 ++++---- src/components/table.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/editable-header.js b/src/components/editable-header.js index 44c0f46..ff15d11 100644 --- a/src/components/editable-header.js +++ b/src/components/editable-header.js @@ -21,7 +21,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -import { FormControl } from 'react-bootstrap'; +import { FormControl, Button } from 'react-bootstrap'; import Icon from './icon'; class EditableHeader extends React.Component { @@ -85,8 +85,8 @@ class EditableHeader extends React.Component { <FormControl type='text' bsSize='large' value={this.state.title} onChange={this.onChange} style={editStyle} autoFocus /> </form> - <a href={'#'} onClick={this.save}><Icon icon='check' style={iconStyle} /></a> - <a href={'#'} onClick={this.cancel}><Icon icon='times' style={iconStyle} /></a> + <Button bsStyle="link" onClick={this.save}><Icon icon='check' style={iconStyle} /></Button> + <Button bsStyle="link" onClick={this.cancel}><Icon icon='times' style={iconStyle} /></Button> </div>; } @@ -95,7 +95,7 @@ class EditableHeader extends React.Component { {this.state.title} </h1> - <a href={'#'} onClick={this.edit}><Icon icon='edit' style={iconStyle} /></a> + <Button bsStyle="link" onClick={this.edit}><Icon icon='edit' style={iconStyle} /></Button> </div>; } } diff --git a/src/components/table.js b/src/components/table.js index b81b63a..0eaac85 100644 --- a/src/components/table.js +++ b/src/components/table.js @@ -74,7 +74,7 @@ class CustomTable extends Component { if (linkKey && data[linkKey] != null) { cell.push(<Link to={child.props.link + data[linkKey]}>{content}</Link>); } else if (child.props.clickable) { - cell.push(<a href={'#'} onClick={() => child.props.onClick(index)}>{content}</a>); + cell.push(<Button bsStyle="link" onClick={() => child.props.onClick(index)}>{content}</Button>); } else { cell.push(content); }