From beaa1fa614d96507c576b5f3823160b408b17a49 Mon Sep 17 00:00:00 2001 From: Matthew Smith Date: Mon, 8 Jun 2015 18:57:17 -0600 Subject: [PATCH] [changed] `PaginationButton` to use `SafeAnchor` Using the `SafeAnchor` for better accessibility. Per #786 commitcomment-11527424 Resolves #788 --- src/PaginationButton.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/PaginationButton.js b/src/PaginationButton.js index 0238b5b9b7..e49e1344ca 100644 --- a/src/PaginationButton.js +++ b/src/PaginationButton.js @@ -2,6 +2,7 @@ import React from 'react'; import classNames from 'classnames'; import BootstrapMixin from './BootstrapMixin'; import createSelectedEvent from './utils/createSelectedEvent'; +import SafeAnchor from './SafeAnchor'; const PaginationButton = React.createClass({ mixins: [BootstrapMixin], @@ -25,9 +26,6 @@ const PaginationButton = React.createClass({ }, handleClick(event) { - // This would go away once SafeAnchor is available - event.preventDefault(); - if (this.props.onSelect) { let selectedEvent = createSelectedEvent(this.props.eventKey); this.props.onSelect(event, selectedEvent); @@ -35,14 +33,22 @@ const PaginationButton = React.createClass({ }, render() { - let classes = this.getBsClassSet(); + let classes = { + active: this.props.active, + disabled: this.props.disabled, + ...this.getBsClassSet() + }; - classes.active = this.props.active; - classes.disabled = this.props.disabled; + let { + className, + ...anchorProps // eslint-disable-line object-shorthand + } = this.props; return ( -
  • - {this.props.children} +
  • +
  • ); }