Skip to content
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

fix: Chrome tooltip overlays dropdown options #3546

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/components/Extensibility/components/Widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,9 @@ export function Widget({
return null;
}
return Array.isArray(sanitizedValue) && !Renderer.array ? (
sanitizedValue.map(valueItem => (
sanitizedValue.map((valueItem, index) => (
<SingleWidget
key={index}
{...props}
inlineRenderer={inlineRenderer}
Renderer={Renderer}
Expand Down
15 changes: 15 additions & 0 deletions src/shared/components/Dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ComboBox, ComboBoxItem, FlexBox } from '@ui5/webcomponents-react';
import { useTranslation } from 'react-i18next';
import { Tooltip } from 'shared/components/Tooltip/Tooltip';
import { Label } from '../../../shared/ResourceForm/components/Label';
import { useRef } from 'react';

export function Dropdown({
accessibleName,
Expand All @@ -20,6 +21,7 @@ export function Dropdown({
}) {
if (!props.readOnly) delete props.readOnly;
const { t } = useTranslation();
const flexBoxRef = useRef(null);
if (!options || !options.length) {
options = [
{
Expand Down Expand Up @@ -48,6 +50,18 @@ export function Dropdown({
onKeyDown={event => {
event.preventDefault();
}}
onClick={() => {
flexBoxRef?.current
?.querySelector('#select-dropdown')
?.shadowRoot?.querySelector('ui5-icon')
?.click();
}}
onFocus={() => {
flexBoxRef?.current
?.querySelector('#select-dropdown')
?.shadowRoot?.querySelector('input')
?.setAttribute('autocomplete', 'off');
}}
onSelectionChange={onSelectionChange}
value={options.find(o => o.key === selectedKey)?.text}
ref={_ref}
Expand All @@ -61,6 +75,7 @@ export function Dropdown({

return (
<FlexBox
ref={flexBoxRef}
className="flexbox-gap full-width"
justifyContent="Center"
direction="Column"
Expand Down
Loading