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 React from 'react';
import classNames from 'classnames'; import classNames from 'classnames';
import { findDOMNode } from 'react-dom';
import Icon from '../icon'; import Icon from '../icon';
import omit from 'omit.js'; 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 // Handle auto focus when click button in Chrome
handleMouseUp = (e) => { handleMouseUp = (e) => {
(findDOMNode(this) as HTMLElement).blur();
if (this.props.onMouseUp) { if (this.props.onMouseUp) {
this.props.onMouseUp(e); this.props.onMouseUp(e);
} }

View File

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

View File

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

View File

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

View File

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