Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Alex Jester

keeping the focus when using Flip on an input

Go to solution Solved by GreenSock,

Recommended Posts

Posted (edited)

Hello,

I am trying to animate an input element using Flip for when the user is typing something, but when Flip is called my input is loosing the focus.

I tried calling a onComplete: function() { input.focus() }, but that doesn't work...

See the Pen KKQWOdV by jester6 (@jester6) on CodePen

Edited by Alex Jester
I added a codepen example of what I am trying to achieve
Link to comment
Share on other sites

  • Solution

Thanks for providing a minimal demo! I wish everyone did such a great job of boiling the question down and including a succinct demo. 

 

You're doing a bunch of extra work on every key press that really isn't necessary - here's how I'd do it: 

See the Pen poaPzgp?editors=0010 by GreenSock (@GreenSock) on CodePen

 

Does that work better for you? 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Now I understand it :)

It works perfectly!

It's already live, obviously the final version is more stylish here with the search field Intreb BT - Banca Transilvania

Thank you so much!

  • Like 2
Link to comment
Share on other sites

What a nice effect! Thanks for sharing Alex!

  • Thanks 1
Link to comment
Share on other sites

Thank you!

I'm happy to be using GSAP :)

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×