Skip to content

Commit

Permalink
Merge pull request ant-design#5597 from kenaniah/accessibility
Browse files Browse the repository at this point in the history
Improves link + button focusing
  • Loading branch information
afc163 authored Apr 5, 2017
2 parents c5059e5 + ed434c5 commit accb6cb
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
2 changes: 0 additions & 2 deletions components/button/button.tsx
Original file line number Diff line number Diff line change
@@ -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';

Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions components/form/demo/normal-login.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
);
Expand Down
2 changes: 1 addition & 1 deletion components/form/demo/register.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}>
Expand Down
4 changes: 4 additions & 0 deletions components/style/core/base.less
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ a {
cursor: pointer;
transition: color .3s ease;

&:focus {
text-decoration: underline;
}

&:hover {
color: @link-hover-color;
}
Expand Down
3 changes: 3 additions & 0 deletions site/theme/static/common.less
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ body {

a {
transition: color .3s ease;
&:focus {
text-decoration: underline;
}
}

.main-wrapper {
Expand Down

0 comments on commit accb6cb

Please sign in to comment.