Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add closeButtonLabel to flyout #1031

Merged
merged 5 commits into from
Jul 26, 2018
Merged

Conversation

timroes
Copy link
Contributor

@timroes timroes commented Jul 19, 2018

Give the FlyOut component a property to overwrite the aria-label of the close button, so consumers can make this more specific to their flyout (e.g. relabeling it to: "Close Inspector").

Copy link
Contributor

@cchaos cchaos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for adding! I just had one main comment about the name of the prop.

/**
* Specify an aria-label for the close button of the flyout.
*/
closeButtonLabel: PropTypes.string,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you rename this to closeButtonAriaLabel so that it's absolutely clear by the prop name itself what the "label" is?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other option is to start a closeButtonProps object to handle more than just the aria-label.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went with closeButtonAriaLabel, since I think if we allow overwriting everything on the button, consumers might be able to mess around too much with the close button as it is.

@@ -98,10 +107,15 @@ EuiFlyout.propTypes = {
* Locks the mouse / keyboard focus to within the flyout
*/
ownFocus: PropTypes.bool,
/**
* Specify an aria-label for the close button of the flyout.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No period necessary here

expect(label).toBe('Closes this dialog');
});

test('has a default label for the close button', () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this test read as 'has a custom label for close button'?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Of course... copy-paste-error :D

Copy link
Contributor

@chandlerprall chandlerprall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, code review

@timroes timroes merged commit 7f34483 into elastic:master Jul 26, 2018
@timroes timroes deleted the close-btn-label branch July 26, 2018 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants