Skip to content

Fix: throw error if accordion element is not found #103

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
Jan 3, 2025

Conversation

Tresor-Kasenda
Copy link
Contributor

This pull request includes a critical update to the Accordion class in the packages/accordion/src/accordion.ts file. The most important changes are focused on improving error handling and type safety.

Error handling improvements:

  • Added a check to ensure the accordionEl element exists and throws an error if it is not found.

Type safety enhancements:

  • Updated the filter function for this.items to include type annotations, ensuring item is properly typed as an object with a parentElement property.

@Johnkat-Mj Johnkat-Mj self-requested a review January 3, 2025 21:17
Copy link
Member

@Johnkat-Mj Johnkat-Mj left a comment

Choose a reason for hiding this comment

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

All correct

@Johnkat-Mj Johnkat-Mj merged commit 05464f2 into main Jan 3, 2025
@Johnkat-Mj Johnkat-Mj deleted the accordion-102-verification-element-exist branch January 19, 2025 16:02
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.

2 participants