From d259ee87789402524fe728b7894f4f7df0e9c332 Mon Sep 17 00:00:00 2001 From: Greg Thompson Date: Tue, 23 Mar 2021 08:42:32 -0500 Subject: [PATCH] show all htmlattribute types (#4659) --- .../guide_section_props_description.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src-docs/src/components/guide_section/guide_section_parts/guide_section_props_description.tsx b/src-docs/src/components/guide_section/guide_section_parts/guide_section_props_description.tsx index de94ee41891..344672474a1 100644 --- a/src-docs/src/components/guide_section/guide_section_parts/guide_section_props_description.tsx +++ b/src-docs/src/components/guide_section/guide_section_parts/guide_section_props_description.tsx @@ -26,14 +26,17 @@ export const GuideSectionPropsDescription: FunctionComponent !!extendedTypesInfo[type]) : []; + // if all extendedTypes are HTMLAttributes, show them all // if there is an HTMLAttributes type present among others, remove HTMLAttributes - if (extendedTypes.includes('HTMLAttributes') && extendedTypes.length > 1) { - const htmlAttributesIndex = extendedTypes.indexOf('HTMLAttributes'); - extendedTypes.splice(htmlAttributesIndex, 1); + if (!extendedTypes.every((type) => type.indexOf('HTMLAttributes') > -1)) { + if (extendedTypes.includes('HTMLAttributes') && extendedTypes.length > 1) { + const htmlAttributesIndex = extendedTypes.indexOf('HTMLAttributes'); + extendedTypes.splice(htmlAttributesIndex, 1); + } } const extendedTypesElements = extendedTypes.map((type: any, index: any) => (