The $idField variable is never used throughout the code, seems to be an attempt to sanitize the $id. I've added some more filtering to produce a usable id. Should work for multiple editors as well.
Testing Instructions
Testing instructions can be found in the issue description.
Before, using code given in #11190, by default textarea was visible and after applying patch by default TinyMCE gets visible.
Square-brackets([]) replaced with the underscores(_) in name so found no problem in that also.
Tested multiple TinyMCE editors on the same page.
this should be faster:
$id = str_replace('[', '_', substr(trim($name), 0, -1));