Skip to content

fix: do not throw when overlayClass is set to empty string - #7386

Merged
web-padawan merged 2 commits into
mainfrom
fix/overlay-class-empty-string
May 7, 2024
Merged

web-padawan merged 2 commits into
mainfrom
fix/overlay-class-empty-string

Conversation

@web-padawan

Copy link
Copy Markdown
Member

Description

Fixes vaadin/flow-components#6274

Type of change

  • Bugfix


// Add new classes based on the overlayClass
const classesToAdd = typeof overlayClass === 'string' ? overlayClass.split(' ') : [];
const classesToAdd = typeof overlayClass === 'string' ? overlayClass.split(' ').filter(Boolean) : [];

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The reason of the problem is that ''.split(' ') produces an array [''] so we need to filter out empty string.

@web-padawan
web-padawan force-pushed the fix/overlay-class-empty-string branch from e67addd to 355bf34 Compare May 6, 2024 13:42
@sonarqubecloud

sonarqubecloud Bot commented May 6, 2024

Copy link
Copy Markdown

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@web-padawan
web-padawan merged commit bf7ee1e into main May 7, 2024
@web-padawan
web-padawan deleted the fix/overlay-class-empty-string branch May 7, 2024 06:26
web-padawan added a commit that referenced this pull request May 7, 2024
…7388)

Co-authored-by: Serhii Kulykov <iamkulykov@gmail.com>
web-padawan added a commit that referenced this pull request May 7, 2024
…7387)

Co-authored-by: Serhii Kulykov <iamkulykov@gmail.com>
@vaadin-bot

Copy link
Copy Markdown
Collaborator

This ticket/PR has been released with Vaadin 24.5.0.alpha1 and is also targeting the upcoming stable 24.5.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resetting DateTimePicker's overlayClassName does not work

3 participants