Skip to content

Commit

Permalink
fix one test failure by applying startTransition
Browse files Browse the repository at this point in the history
  • Loading branch information
mvidner committed Jan 30, 2025
1 parent e4a9990 commit 8212311
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions web/src/components/storage/DriveEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
* find current contact information at www.suse.com.
*/

import React, { useId, useRef, useState } from "react";
import React, { useId, useRef, useState, startTransition } from "react";
import { useNavigate, generatePath } from "react-router-dom";
import { _, formatList } from "~/i18n";
import { sprintf } from "sprintf-js";
Expand Down Expand Up @@ -424,7 +424,12 @@ const DriveSelector = ({ drive, selected, toggleAriaLabel }) => {
driveHandler.switch(newDriveName);
setIsOpen(false);
};
const onToggle = () => setIsOpen(!isOpen);
// const onToggle = () => setIsOpen(!isOpen);
const onToggle = () => {
console.log("onToggle BEFORE");
startTransition(() => setIsOpen(!isOpen));
console.log("onToggle AFTER");
};

return (
<MenuContainer
Expand Down

0 comments on commit 8212311

Please sign in to comment.