mdgriffith / elm-ui

What if you never had to write CSS again?
https://package.elm-lang.org/packages/mdgriffith/elm-ui/latest/
BSD 3-Clause "New" or "Revised" License
1.34k stars 110 forks source link

Make text unselectable? #336

Closed mitchellwrosen closed 2 years ago

mitchellwrosen commented 2 years ago

Hi, is it possible to make text unselectable using this library?

From a cursory google search it looks like user-select: none CSS is the trick. However, I couldn't figure out how to accomplish that with the external API.

Thanks!

Viir commented 2 years ago

Yes, you can disable selection with this attribute:

Element.htmlAttribute (Html.Attributes.style "user-select" "none")
mitchellwrosen commented 2 years ago

Nice, I missed that. Thanks.