1) If I were a little taller, I would be able to reach the top of the shelf.
is grammatically correct. The other one is substandard but probably more common among native speakers of English. Some linguists will claim that this is the way native Anglophones speak and write, so it's standard, idiomatic, and acceptable.
I claim only that it's standard and idiomatic. Because it's idiomatic for so many native speakers, it's beyond the reach of grammar, as are all idioms. That doesn't mean that it can't be criticized because of its style: style isn't grammar; it's aesthetics.
Acceptable is a value (aesthetic) judgment, not an indisputable fact. Some native Anglophones find sentence 2 acceptable, but I don't. Many other native Anglophones don't either. We are a dying breed, however.
If you're asked this question on a standardized test of English, like the TOEFL, TOEIC, or IELTS, you must choose "If I were taller" or you'll lose points. If you're writing for publication in an academic journal, there's a 50-50 chance that the editors and peer reviewers will require "If I were taller".
Anywhere else, most native speakers won't notice the difference because they don't know the grammar and don't understand that saying "If I was taller" would imply that now you are shorter (which is possible if you're old enough, because people do shrink in stature when they reach old age) or that someone else's perception that you were taller in the past is mistaken, so you'd have to finish the sentence with "I don't remember it", "you must have grown a few inches", or "I must have been wearing stilts".
You can read a Writer's Digest blog about this point here.