When one is in the middle of a process, activity, or conversation, to adjust rapidly, effectively, and intelligently to new developments or changing circumstances.
How often have the words fake it and think on one's feet occurred in a corpus of books? (source: Google Ngram Viewer )