-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Labels
bugSomething isn't workingSomething isn't workingepicjiraThis task is referenced in a story of JiraThis task is referenced in a story of Jira
Milestone
Description
Describe the bug
The onBlur event is currently executing when the component is disabled. It also gains focus, leading to strange behaviour when tabbing between elements from the screen, since it does not jump between enabled items but also disabled selects.
To Reproduce
Code example:
const () => {
const [value, setValue] = useState("");
const options = [
{ label: "Option 01", value: "1" },
{ label: "Option 02", value: "2" },
{ label: "Option 03", value: "3" },
{ label: "Option 04", value: "4" },
];
const onBlur = ({ value, error }) => {
setValue(value);
console.log(value);
};
return (
<DxcSelect
label="Example"
placeholder="Choose an option"
options={options}
value={value}
onBlur={onBlur}
disabled
/>
);
};
Expected behaviour
The onBlur event must not be executed when the component is disabled.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingepicjiraThis task is referenced in a story of JiraThis task is referenced in a story of Jira
Type
Projects
Status
Done