Skip to content

Commit

Permalink
Fix #5308: Dropdown icon pass overlay visible state
Browse files Browse the repository at this point in the history
  • Loading branch information
melloware committed Nov 13, 2023
1 parent ab59967 commit f83b102
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions components/doc/dropdown/templatedoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export function TemplateDoc(props) {
<Dropdown value={selectedCountry} onChange={(e) => setSelectedCountry(e.value)} options={countries} optionLabel="name" placeholder="Select a Country"
valueTemplate={selectedCountryTemplate} itemTemplate={countryOptionTemplate} className="w-full md:w-14rem" panelFooterTemplate={panelFooterTemplate}
dropdownIcon={(opts) => {
return opts.iconProps.overlayVisibleState ? <ChevronRightIcon {...opts.iconProps} /> : <ChevronDownIcon {...opts.iconProps} />;
return opts.iconProps['data-pr-overlay-visible'] ? <ChevronRightIcon {...opts.iconProps} /> : <ChevronDownIcon {...opts.iconProps} />;
}}
/>
`,
Expand Down Expand Up @@ -127,7 +127,7 @@ export default function TemplateDemo() {
<Dropdown value={selectedCountry} onChange={(e) => setSelectedCountry(e.value)} options={countries} optionLabel="name" placeholder="Select a Country"
valueTemplate={selectedCountryTemplate} itemTemplate={countryOptionTemplate} className="w-full md:w-14rem" panelFooterTemplate={panelFooterTemplate}
dropdownIcon={(opts) => {
return opts.iconProps.overlayVisibleState ? <ChevronRightIcon {...opts.iconProps} /> : <ChevronDownIcon {...opts.iconProps} />;
return opts.iconProps['data-pr-overlay-visible'] ? <ChevronRightIcon {...opts.iconProps} /> : <ChevronDownIcon {...opts.iconProps} />;
}}/>
</div>
)
Expand Down Expand Up @@ -200,7 +200,7 @@ export default function TemplateDemo() {
<Dropdown value={selectedCountry} onChange={(e: DropdownChangeEvent) => setSelectedCountry(e.value)} options={countries} optionLabel="name" placeholder="Select a Country"
valueTemplate={selectedCountryTemplate} itemTemplate={countryOptionTemplate} className="w-full md:w-14rem" panelFooterTemplate={panelFooterTemplate}
dropdownIcon={(opts) => {
return opts.iconProps.overlayVisibleState ? <ChevronRightIcon {...opts.iconProps} /> : <ChevronDownIcon {...opts.iconProps} />;
return opts.iconProps['data-pr-overlay-visible'] ? <ChevronRightIcon {...opts.iconProps} /> : <ChevronDownIcon {...opts.iconProps} />;
}}/>/>
</div>
)
Expand All @@ -227,7 +227,7 @@ export default function TemplateDemo() {
panelFooterTemplate={panelFooterTemplate}
className="w-full md:w-14rem"
dropdownIcon={(opts) => {
return opts.iconProps.overlayVisibleState ? <ChevronRightIcon {...opts.iconProps} /> : <ChevronDownIcon {...opts.iconProps} />;
return opts.iconProps['data-pr-overlay-visible'] ? <ChevronRightIcon {...opts.iconProps} /> : <ChevronDownIcon {...opts.iconProps} />;
}}
/>
</div>
Expand Down
2 changes: 1 addition & 1 deletion components/lib/dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ export const Dropdown = React.memo(
const dropdownIconProps = mergeProps(
{
className: cx('dropdownIcon'),
overlayVisibleState
'data-pr-overlay-visible': overlayVisibleState
},
ptm('dropdownIcon')
);
Expand Down

0 comments on commit f83b102

Please sign in to comment.