I mean, they have mastered that particular art: their floors really suck and all that. Having low-level, short-range gravitational pull would be a truly universal way to attach to any arbitrary surface or object.
Plus a technology like that existing would explain why things don't usually fall off tables when a starship undergoes combat maneuvers or is hit by enemy fire. It wouldn't be able to hold Ensign Airborne's shoes to the deck, but they would prevent his collection of glass animals from falling from the shelf at his cabin all right.
Artificial gravity is extremely reliable in Star Trek and apparently doesn't require much power, so it would be a good way to keep commbadges attached. Hopefully, it also holds together the uniforms themselves (remember how they open where there are no visible seams or zippers?), so that we can keep on praying for a rare spatiotemporal anomaly that would unravel the fabric at an opportune moment.