Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to add button type to CAccordionButton when used through CAccordionHeader?#252

Answeredbymrholek
PoeppingT asked this question inQ&A
Discussion options

Hi all,

I'm using theCAccordion construct as part of a layered form, very useful! I have just one problem -- because theCAccordionButton created by theCAccordionHeader component doesn't havetype=button applied, my Formik form things I'm submitting the form and doing validations before I want.

Looking at the code, it looks like theCAccordionButton could support this if used directly:

    return (      <button        className={_className}        {...rest}        aria-expanded={!visible}        onClick={() => setVisible(!visible)}        ref={ref}      >        {children}      </button>    )

but theCAccordionHeader does not apply any such type (via therest prop):

    return (      <div className={_className} {...rest} ref={ref}>        <CAccordionButton>{children}</CAccordionButton>      </div>    )

Is there a way to pass this type configuration through theCAccordionHeader to still make use of theref and collapse functionality?

You must be logged in to vote

@PoeppingT it's a bug, I will fix it next release.

Replies: 1 comment

Comment options

@PoeppingT it's a bug, I will fix it next release.

You must be logged in to vote
0 replies
Answer selected byPoeppingT
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
Q&A
Labels
None yet
2 participants
@PoeppingT@mrholek

[8]ページ先頭

©2009-2025 Movatter.jp