add `dynamicPlacement` tooltip option

In light of @nickroberts having had to wait ~5 months to get action on his pull request, I've taken the liberty of porting (with some cosmetic code changes) #6848 to the current latest `3.0.0-wip`, to save him the trouble.

The automated tests still pass and it indeed seems to work based on limited manual testing.