Skip to content

Commit

Permalink
maybe this will work
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielle Whyte committed Nov 18, 2024
1 parent 2c9d887 commit fd672a8
Showing 1 changed file with 39 additions and 34 deletions.
73 changes: 39 additions & 34 deletions packages/perseus/src/widgets/dropdown/dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,41 +82,46 @@ class Dropdown extends React.Component<Props> implements Widget {
];

return (
<UniqueIDProvider scope="dropdown-widget" mockOnFirstRender={true}>
{(ids) => (
<View
// NOTE(jared): These are required to prevent weird behavior
// When there's a dropdown in a zoomable table.
onClick={(e) => {
e.stopPropagation();
}}
onTouchStart={(e) => {
e.stopPropagation();
}}
>
{this.props.visibleLabel && (
<LabelLarge
tag="label"
htmlFor={ids.get("dropdown")}
<View
// NOTE(jared): These are required to prevent weird behavior
// When there's a dropdown in a zoomable table.
onClick={(e) => {
e.stopPropagation();
}}
onTouchStart={(e) => {
e.stopPropagation();
}}
>
<UniqueIDProvider
scope="dropdown-widget"
mockOnFirstRender={true}
>
{(ids) => (
<>
{this.props.visibleLabel && (
<LabelLarge
tag="label"
htmlFor={ids.get("dropdown")}
>
{this.props.visibleLabel}
</LabelLarge>
)}
<SingleSelect
id={ids.get("dropdown")}
placeholder=""
onChange={(value) =>
this._handleChange(parseInt(value))
}
selectedValue={String(this.props.selected)}
disabled={this.props.apiOptions.readOnly}
aria-label={this.props.ariaLabel}
>
{this.props.visibleLabel}
</LabelLarge>
)}
<SingleSelect
id={ids.get("dropdown")}
placeholder=""
onChange={(value) =>
this._handleChange(parseInt(value))
}
selectedValue={String(this.props.selected)}
disabled={this.props.apiOptions.readOnly}
aria-label={this.props.ariaLabel}
>
{children}
</SingleSelect>
</View>
)}
</UniqueIDProvider>
{children}
</SingleSelect>
</>
)}
</UniqueIDProvider>
</View>
);
}
}
Expand Down

0 comments on commit fd672a8

Please sign in to comment.