Skip to content

fix(pfFilter): do not allow empty filters #593

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

Merged
merged 1 commit into from
Aug 25, 2017

Conversation

dtaylor113
Copy link
Member

Description

Updated so that hitting [Enter] on an empty input filter field doesn't create an empty filter.

Fixes #509

@@ -89,7 +89,7 @@ angular.module('patternfly.filters').component('pfFilterFields', {
}

function onValueKeyPress (keyEvent) {
if (keyEvent.which === 13) {
if (keyEvent.which === 13 && ctrl.currentValue && ctrl.currentValue.length > 0) {
Copy link
Member

Choose a reason for hiding this comment

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

Simplify to:
if (keyEvent.which === 13 && ctrl.currentValue.length) {

Copy link
Member Author

@dtaylor113 dtaylor113 Aug 23, 2017

Choose a reason for hiding this comment

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

@jeff-phillips-18 ctrl.currentValue is set/reset to null so null.length throws an error.

@jeff-phillips-18 jeff-phillips-18 merged commit 256a766 into patternfly:master Aug 25, 2017
@dtaylor113 dtaylor113 deleted the pfFilter-no-empty branch October 19, 2017 18:29
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