Merge pull request #5597 from kenaniah/accessibility

Improves link + button focusing
This commit is contained in:
偏右 2017-04-05 14:56:33 +08:00 committed by GitHub
commit accb6cbfeb
5 changed files with 10 additions and 5 deletions

View File

@ -1,6 +1,5 @@
import React from 'react';
import classNames from 'classnames';
import { findDOMNode } from 'react-dom';
import Icon from '../icon';
import omit from 'omit.js';
@ -119,7 +118,6 @@ export default class Button extends React.Component<ButtonProps, any> {
// Handle auto focus when click button in Chrome
handleMouseUp = (e) => {
(findDOMNode(this) as HTMLElement).blur();
if (this.props.onMouseUp) {
this.props.onMouseUp(e);
}

View File

@ -51,11 +51,11 @@ class NormalLoginForm extends React.Component {
})(
<Checkbox>Remember me</Checkbox>
)}
<a className="login-form-forgot">Forgot password</a>
<a className="login-form-forgot" href="">Forgot password</a>
<Button type="primary" htmlType="submit" className="login-form-button">
Log in
</Button>
Or <a>register now!</a>
Or <a href="">register now!</a>
</FormItem>
</Form>
);

View File

@ -212,7 +212,7 @@ class RegistrationForm extends React.Component {
{getFieldDecorator('agreement', {
valuePropName: 'checked',
})(
<Checkbox>I have read the <a>agreement</a></Checkbox>
<Checkbox>I have read the <a href="">agreement</a></Checkbox>
)}
</FormItem>
<FormItem {...tailFormItemLayout}>

View File

@ -61,6 +61,10 @@ a {
cursor: pointer;
transition: color .3s ease;
&:focus {
text-decoration: underline;
}
&:hover {
color: @link-hover-color;
}

View File

@ -20,6 +20,9 @@ body {
a {
transition: color .3s ease;
&:focus {
text-decoration: underline;
}
}
.main-wrapper {