adarshpastakia / aurelia-ui-framework

A bespoke UI Framework built on Aurelia for desktop business application
https://adarshpastakia.github.io/auf-demo-v4/
MIT License
152 stars 27 forks source link

[Discussion] reverse the default of `user-select` to be selectable #119

Closed avrahamcool closed 6 years ago

avrahamcool commented 6 years ago

the current behavior is that everything is unselectable. you have to apply the ui-selectable class to make something selectable. but it's very counter intuitive, as most real world sites let you select text. this should be inverted: the default should be that everything is selectable (just dont apply anythig to the html tag), and we should have a class for ui-unselectable.

adarshpastakia commented 6 years ago

The reason for it was that this framework was designed for web based applications, however in the case of using with websites I agree so for that scenario we can have a flag in sass whether to apply no select globally or not

avrahamcool commented 6 years ago

I created a sass flag

//default user-select behaviour
$disableUserSelection: true !default;

and added a new class ui-unselectable that can be applied on any child. just like the ui-selectable that was already available.

  .ui-selectable {
    @include user-select(text);
  }
  .ui-unselectable {
    @include user-select(none);
  }

closed via: https://github.com/adarshpastakia/aurelia-ui-framework/commit/a25035ebd8f88cec2115c6cdaada1bd77e615328