What do you do?

Last week we went to the library and my 2 year old had a screaming fit because she dropped her magnets on the floor. I tried to calm her but after 2 minutes she was still going at it, and being in a library I wasn't going to continue trying, so we left. Today she had a fit there again but luckily I was able to calm her. I don't want to have to leave every place she throws a fit, but I don't like all eyes on me either.