Semantic-Org/Semantic-UI-React

Rework TransitionablePortal callbacks for consistency

Open

#2.423 aberto em 10 de jan. de 2018

Ver no GitHub
 (9 comments) (0 reactions) (0 assignees)JavaScript (4.065 forks)batch import
bughelp wanted

Métricas do repositório

Stars
 (13.136 stars)
Métricas de merge de PR
 (Nenhuma PRs mesclada em 30d)

Description

Steps

  1. Create a controlled <TransitionablePortal />
  2. Toggle the open prop from false to true
  3. Trigger a close with ESC or click outside

Expected Result

  1. On prop change to open, the onOpen callback should not be called. This is a programmatic prop change, not a trigger click.
  2. When a close event is triggered, the onClose callback should be called before starting the transition as the user may choose to disregard the close request.

Actual Result

  1. On prop change to open, onOpen is called at the beginning and end of the open transition
  2. When a close event is triggered, the onClose callback is called after the onHide callback. There is no way to handle the close request and ignore it.

See the test case for proposed fixes.

Version

0.77.2

Testcase

https://codesandbox.io/s/rj8qv1yl2o

Guia do colaborador