BitMEX-scaled-orders icon indicating copy to clipboard operation
BitMEX-scaled-orders copied to clipboard

Preview doesn't properly close if state changes are reverted

Open Effanuel opened this issue 5 years ago • 0 comments

Expected Behavior

<PreviewContainer /> should properly close, if <ScaledContainer /> components states are the same as they were after <PreviewContainer /> was opened.

Current Behavior

If some kind of change is made and then reverted, <PreviewContainer /> doesn't close on "Preview" click.

  • Current situation is handled using boolean cache variable that sets to false after every state change.

Possible Solution

Save state after opening and check before closing/opening.

Steps to Reproduce

  1. Open <PreviewContainer />;
  2. Delete any number of <PreviewContainer /> input and then revert it;
  3. Press "Preview".

Possible Implementation

After opening the <PreviewContainer />, stringify and save its state to compare it before every open/close of <PreviewContainer />.

Effanuel avatar Jan 25 '20 15:01 Effanuel