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: Mobile action list was not closing after action click #1258

Merged
merged 1 commit into from Jan 16, 2023
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -33,6 +33,8 @@ export const ActionList: React.FC<{
>
{props.actions.map(action =>
<MobileAction
key={action.id}
onClick={async () => await props.mobileState.close()}
action={action}
mobileState={props.mobileState}/>
)}
Expand Down
Expand Up @@ -28,11 +28,15 @@ import { ActionList } from "gui/connections/MobileComponents/Form/ActionList";

export const MobileAction: React.FC<{
action: IAction,
mobileState: MobileState
mobileState: MobileState,
onClick?: ()=> Promise<void>
}> = (props) => {

function onClick(event: React.MouseEvent<HTMLButtonElement>) {
uiActions.actions.onActionClick(props.action)(event, props.action)
async function onClick(event: React.MouseEvent<HTMLButtonElement>) {
if (props.onClick){
await props.onClick();
}
await uiActions.actions.onActionClick(props.action)(event, props.action);
}

return (
Expand Down