question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add slide up / down animation to User Feedback survey

See original GitHub issue

Feature Description

The User Feedback survey is missing the slide up / down animation to show / hide the survey.


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The user input survey box should not just appear, it should have an animation when it appears and disappears:
    • When it appears, it should slide up into view from the bottom of the screen.
    • When it disappears (e.g. completion or dismissal), it should slide down out of view back “into” the bottom of the screen.
  • Potentially this can technically use https://material-ui.com/components/transitions/ - this is not a requirement though, just a note.

Implementation Brief

  • Install the @material-ui/core package.
  • Using assets/js/components/surveys/CurrentSurvey.js,
    • Create a new state variable, animateSurvey which is a boolean, with false as default value.
    • Use the useMount hook to set the animateSurvey to true.
    • Create new function handleAnimationOnExited which calls the setValues action (which can be found in the dismissSurvey function) to hide the form. Basically the form is hidden and unmounted when the animation is complete.
    • Wrap the markup for the survey questions (not when it has been completed) within the Slide component, imported from @material-ui/core with the following props:
      • direction="up"
      • in={ animateSurvey }
      • onExited={ handleAnimationOnExited }
    • Update the dismissSurvey function to :
      • set animateSurvey to false.
      • Remove the setValues call since we moved it to the handleAnimationOnExited function.

Test Coverage

  • No new tests to be added.

Visual Regression Changes

  • N/A

QA Brief

  • Run storybook locally via the npm run storybook command.
  • Visit the “Surveys -> Current Survey” story.
  • The user feedback survey should slide up upon page load and slide down when closed.

Changelog entry

  • Enhance user survey display with added animation on enter and exit.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
asvinbcommented, Jun 21, 2021

@eugene-manuilov That’s what I thought initially while working on this task. As per the docs:

Direction: the child node will enter from.

So the direction is only for entering, and when exiting the animation, it’ll just do the reverse.

1reaction
asvinbcommented, Jun 10, 2021

Thanks for catching that @tofumatt . Actually when I read your comment, am like it’s weird that we don’t have any callbacks when the animation starts or ends. I checked the docs and voila, we do have the onExited callback, which is called when the animation ends 😃 I’ve updated the IB to reflect that change. Also the Slide component does have the unmountOnExit prop which like the name says, unmounts the children when existing, which we could have used. But then the form data store will not be in sync with that’s visible/unmounted on the page. So I guess we can leave that to the data store to handle.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Pure CSS Slide Up and Slide Down - David Walsh Blog
After playing around with different CSS properties, I've found a way to make a pure CSS sliding effect.
Read more >
Executing UX Animations: Duration and Motion Characteristics
Animations in user experience can help by providing feedback and preventing disorientation or can be distracting, annoying, and dizzying.
Read more >
Add animation to slides​ - Microsoft Support
Try it! Add animation and effects to text, pictures, shapes, and objects in your PowerPoint presentation. Add animations and effects.
Read more >
Animate/transition content smoothly when it appears (after ...
$(".form-feedback .btn").click(async function () { let checkboxes ... I've added an animation to close the slideDown . You could also add a ...
Read more >
Create advanced animations with smart animate
Open the Prototype tab in the right sidebar. · Select layer, group, or frame in the canvas. · Click on the node and...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found