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

todos-inputs: ngIf não funciona com nenhum input do po-ui que tenha required #1980

Open
2 of 10 tasks
guiworks opened this issue Mar 5, 2024 · 3 comments
Open
2 of 10 tasks
Labels
status: awaiting author Additional information has been requested from the author status: triage Issue or pull request that need to be triaged and assigned to a reviewer

Comments

@guiworks
Copy link

guiworks commented Mar 5, 2024

Reprodução

https://po-ui-7ksbea.stackblitz.io/

Passos para reproduzir:

  1. Ter um control com required no html/formbuilder
  2. Criar um ngIf que faça um toggle de true/false para checar o status valid do formulário

Qual o comportamento atual?

Quando um input está com required true e o ngIf faz ele desaparecer, o formulário não reseta esse required dele para false, uma vez que ele não existe mais no formulário, pois o required dele foi setado via html.

Que comportamento você esperava ver?

Caso um input do po-ui esteja ocultado com ngIf, ele deveria resetar também o required. Fiz o teste com input puro do html e o comportamento foi como esperado, ele resetava o valor e o status do formulário ficava válido.

Com isso a gente não consegue criar formgroups dinâmicos com required, pois se tiver que ocultar esse formgroup, o required vai travar a validação do formulário.

Ambiente

  • PO UI: Última versão
  • Angular: Última versão
  • Browser(s):
    • Chrome
    • Firefox
    • Edge
    • Safari
    • IE 11
    • Outros
  • Operating System:
    • Windows
    • macOS
    • Ubuntu
    • Outros
@guiworks guiworks added the bug Something isn't working label Mar 5, 2024
@anliben
Copy link
Contributor

anliben commented Mar 5, 2024

Boa Tarde @guiworks, tudo bem?

Não conseguimos visualizar o código do seu stackblitz, pois foi compartilhado apenas no modo de visualização!
Attr.

@anliben anliben added status: triage Issue or pull request that need to be triaged and assigned to a reviewer status: awaiting author Additional information has been requested from the author and removed bug Something isn't working labels Mar 5, 2024
@guiworks
Copy link
Author

guiworks commented Mar 5, 2024

Opa, boa tarde,
Atualizei o link no post principal

@anliben
Copy link
Contributor

anliben commented Mar 12, 2024

Bom Dia @guiworks, tudo bem?

Os componentes do 'po-ui' são encapsulados e nosso componente precisa que o required seja setado para false para lhe atender. Não temos uma sugestão para seu caso uma vez que todos os formulários required deveriam ser visíveis, podendo aplicar outra abordagem a eles.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: awaiting author Additional information has been requested from the author status: triage Issue or pull request that need to be triaged and assigned to a reviewer
Projects
None yet
Development

No branches or pull requests

2 participants