Feito uma correção de bug onde o diálogo principal de nova conta fechava inesperadamente
This commit is contained in:
committed by
Felipe Coutinho
parent
9b78f839bf
commit
7b3979ad8e
@@ -5,6 +5,12 @@ Todas as mudanças notáveis deste projeto serão documentadas neste arquivo.
|
|||||||
O formato é baseado em [Keep a Changelog](https://keepachangelog.com/pt-BR/1.1.0/),
|
O formato é baseado em [Keep a Changelog](https://keepachangelog.com/pt-BR/1.1.0/),
|
||||||
e este projeto adere ao [Versionamento Semântico](https://semver.org/lang/pt-BR/).
|
e este projeto adere ao [Versionamento Semântico](https://semver.org/lang/pt-BR/).
|
||||||
|
|
||||||
|
## [1.6.2] - 2026-02-19
|
||||||
|
|
||||||
|
### Corrigido
|
||||||
|
|
||||||
|
- Bug no mobile onde, ao selecionar um logo no diálogo de criação de conta/cartão, o diálogo principal fechava inesperadamente: adicionado `stopPropagation` nos eventos de click/touch dos botões de logo e delay com `requestAnimationFrame` antes de fechar o seletor de logo
|
||||||
|
|
||||||
## [1.6.1] - 2026-02-18
|
## [1.6.1] - 2026-02-18
|
||||||
|
|
||||||
### Adicionado
|
### Adicionado
|
||||||
|
|||||||
@@ -126,7 +126,10 @@ export function CardDialog({
|
|||||||
currentName: formState.name,
|
currentName: formState.name,
|
||||||
onUpdate: (updates) => {
|
onUpdate: (updates) => {
|
||||||
updateFields(updates);
|
updateFields(updates);
|
||||||
|
// Delay closing to avoid race condition on mobile
|
||||||
|
requestAnimationFrame(() => {
|
||||||
setLogoDialogOpen(false);
|
setLogoDialogOpen(false);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -188,11 +191,29 @@ export function CardDialog({
|
|||||||
: "Atualize as informações do cartão selecionado.";
|
: "Atualize as informações do cartão selecionado.";
|
||||||
const submitLabel = mode === "create" ? "Salvar cartão" : "Atualizar cartão";
|
const submitLabel = mode === "create" ? "Salvar cartão" : "Atualizar cartão";
|
||||||
|
|
||||||
|
const handleMainDialogOpenChange = useCallback(
|
||||||
|
(open: boolean) => {
|
||||||
|
if (!open && logoDialogOpen) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setDialogOpen(open);
|
||||||
|
},
|
||||||
|
[logoDialogOpen, setDialogOpen],
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Dialog open={dialogOpen} onOpenChange={setDialogOpen}>
|
<Dialog open={dialogOpen} onOpenChange={handleMainDialogOpenChange}>
|
||||||
{trigger ? <DialogTrigger asChild>{trigger}</DialogTrigger> : null}
|
{trigger ? <DialogTrigger asChild>{trigger}</DialogTrigger> : null}
|
||||||
<DialogContent className="">
|
<DialogContent
|
||||||
|
className=""
|
||||||
|
onPointerDownOutside={(e) => {
|
||||||
|
if (logoDialogOpen) e.preventDefault();
|
||||||
|
}}
|
||||||
|
onInteractOutside={(e) => {
|
||||||
|
if (logoDialogOpen) e.preventDefault();
|
||||||
|
}}
|
||||||
|
>
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>{title}</DialogTitle>
|
<DialogTitle>{title}</DialogTitle>
|
||||||
<DialogDescription>{description}</DialogDescription>
|
<DialogDescription>{description}</DialogDescription>
|
||||||
|
|||||||
@@ -152,7 +152,10 @@ export function AccountDialog({
|
|||||||
currentName: formState.name,
|
currentName: formState.name,
|
||||||
onUpdate: (updates) => {
|
onUpdate: (updates) => {
|
||||||
updateFields(updates);
|
updateFields(updates);
|
||||||
|
// Delay closing to avoid race condition on mobile
|
||||||
|
requestAnimationFrame(() => {
|
||||||
setLogoDialogOpen(false);
|
setLogoDialogOpen(false);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -205,11 +208,29 @@ export function AccountDialog({
|
|||||||
: "Atualize as informações da conta selecionada.";
|
: "Atualize as informações da conta selecionada.";
|
||||||
const submitLabel = mode === "create" ? "Salvar conta" : "Atualizar conta";
|
const submitLabel = mode === "create" ? "Salvar conta" : "Atualizar conta";
|
||||||
|
|
||||||
|
const handleMainDialogOpenChange = useCallback(
|
||||||
|
(open: boolean) => {
|
||||||
|
if (!open && logoDialogOpen) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
setDialogOpen(open);
|
||||||
|
},
|
||||||
|
[logoDialogOpen, setDialogOpen],
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Dialog open={dialogOpen} onOpenChange={setDialogOpen}>
|
<Dialog open={dialogOpen} onOpenChange={handleMainDialogOpenChange}>
|
||||||
{trigger ? <DialogTrigger asChild>{trigger}</DialogTrigger> : null}
|
{trigger ? <DialogTrigger asChild>{trigger}</DialogTrigger> : null}
|
||||||
<DialogContent className="sm:max-w-xl">
|
<DialogContent
|
||||||
|
className="sm:max-w-xl"
|
||||||
|
onPointerDownOutside={(e) => {
|
||||||
|
if (logoDialogOpen) e.preventDefault();
|
||||||
|
}}
|
||||||
|
onInteractOutside={(e) => {
|
||||||
|
if (logoDialogOpen) e.preventDefault();
|
||||||
|
}}
|
||||||
|
>
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>{title}</DialogTitle>
|
<DialogTitle>{title}</DialogTitle>
|
||||||
<DialogDescription>{description}</DialogDescription>
|
<DialogDescription>{description}</DialogDescription>
|
||||||
|
|||||||
@@ -158,7 +158,13 @@ export function LogoPickerDialog({
|
|||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
key={logo}
|
key={logo}
|
||||||
onClick={() => onSelect(logo)}
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
e.preventDefault();
|
||||||
|
onSelect(logo);
|
||||||
|
}}
|
||||||
|
onPointerDown={(e) => e.stopPropagation()}
|
||||||
|
onTouchStart={(e) => e.stopPropagation()}
|
||||||
className={cn(
|
className={cn(
|
||||||
"flex flex-col items-center gap-1 rounded-md bg-card p-2 text-center text-xs transition-all hover:border-primary hover:bg-primary/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
"flex flex-col items-center gap-1 rounded-md bg-card p-2 text-center text-xs transition-all hover:border-primary hover:bg-primary/5 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
||||||
isActive &&
|
isActive &&
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "openmonetis",
|
"name": "openmonetis",
|
||||||
"version": "1.6.1",
|
"version": "1.6.2",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev --turbopack",
|
"dev": "next dev --turbopack",
|
||||||
|
|||||||
Reference in New Issue
Block a user