Idling problems can be caused by a long list of items from fuel condition, one of the many sensors that the engine requires to run to a physical engine issue like cam shaft issues hence the potentially long list.
Trying to diagnose a running problem by the fact the warning light go out whilst driving without having carried out basic checks for fault codes and engine running data on modern systems is just pure guess work, and even if it was an injector issue the cause of the injector failure has to be found or you will find your self back at square one with a poor engine.
One of the basic diagnostic question to ask your self is, What repairs have I had/have done to the vehicle in recent times prior to the problem as this can often point toward possible cause like a electrical connector not fitted.
Beyond that any guess is as good as any internet search.