Skip to content

Commit

Permalink
fix: all components' user-select style prop's effect on safari
Browse files Browse the repository at this point in the history
  • Loading branch information
07akioni committed Jul 6, 2022
1 parent 3c06a36 commit 1e7bb4a
Show file tree
Hide file tree
Showing 24 changed files with 33 additions and 16 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
- Fix `n-dropdown`'s disabled option has hover style.
- Fix `n-dropdown`'s menu may shift when it's entering.
- Fix `n-dropdown`'s transform origin may not be correct in Chrome.
- Fix `n-radio-button` may not have correct cursor style in some versions of chrome, closes [#3243](https://github.com/TuSimple/naive-ui/issues/3243).
- Fix `n-radio-button` may not have correct cursor style, closes [#3243](https://github.com/TuSimple/naive-ui/issues/3243).
- Fix `n-input`'s text color is too shallow with disabled state in Safari, closes [#3241](https://github.com/TuSimple/naive-ui/issues/3241).
- Fix `n-input`'s separator may have line wrap.
- Fix all components' `user-select` style prop's effect on safari.

### Feats

Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
- 修复 `n-dropdown` 禁用的选项有 hover 样式
- 修复 `n-dropdown` 菜单出现可能会闪
- 修复 `n-dropdown` 菜单的 transform origin 在 Chrome 上可能不正确
- 修复 `n-radio-button` 在某些版本 Chrome 光标样式不正确,关闭 [#3243](https://github.com/TuSimple/naive-ui/issues/3243)
- 修复 `n-radio-button` 光标样式可能不正确,关闭 [#3243](https://github.com/TuSimple/naive-ui/issues/3243)
- 修复 `n-input` 在 disabled 状态下在 Safari 上文本颜色过浅,关闭 [#3241](https://github.com/TuSimple/naive-ui/issues/3241)
- 修复 `n-input` 的分割符可能折行
- 修复所有组件的 `user-select` 样式属性在 safari 的效果

### Feats

Expand Down
10 changes: 0 additions & 10 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@
type="image/svg+xml"
href="/demo/assets/images/naivelogo.svg"
/>
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@docsearch/css@alpha"
/>
<style>
:root {
--docsearch-primary-color: #18a058;
}
</style>
</head>
<body>
<script>
Expand All @@ -42,7 +33,6 @@
deriveTitleFromLocale(pathLocale)
</script>
<div id="app"></div>
<div id="search" style="display: none"></div>
<script type="module" src="__INDEX__"></script>
</body>
</html>
1 change: 1 addition & 0 deletions src/_internal/scrollbar/src/styles/index.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export default cB('scrollbar', `
position: absolute;
pointer-events: none;
user-select: none;
-webkit-user-select: none;
`, [
cM('horizontal', `
left: 2px;
Expand Down
1 change: 1 addition & 0 deletions src/_internal/selection/src/styles/index.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ export default c([
white-space: pre;
visibility: hidden;
user-select: none;
-webkit-user-select: none;
opacity: 0;
`)
]),
Expand Down
1 change: 1 addition & 0 deletions src/breadcrumb/src/styles/index.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ export default cB('breadcrumb', `
color: var(--n-separator-color);
transition: color .3s var(--n-bezier);
user-select: none;
-webkit-user-select: none;
`),
c('&:last-child', [
cE('link', `
Expand Down
1 change: 1 addition & 0 deletions src/button/src/styles/index.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default c([
align-items: center;
justify-content: center;
user-select: none;
-webkit-user-select: none;
text-align: center;
cursor: pointer;
text-decoration: none;
Expand Down
1 change: 1 addition & 0 deletions src/carousel/src/styles/index.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ export default cB('carousel', `
color: var(--n-arrow-color);
border-radius: 8px;
user-select: none;
-webkit-user-select: none;
font-size: 18px;
`, [
c('svg', `
Expand Down
2 changes: 2 additions & 0 deletions src/checkbox/src/styles/index.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ export default c([
flex-shrink: 0;
flex-grow: 0;
user-select: none;
-webkit-user-select: none;
`),
cB('checkbox-box', `
position: absolute;
Expand Down Expand Up @@ -200,6 +201,7 @@ export default c([
color: var(--n-text-color);
transition: color .3s var(--n-bezier);
user-select: none;
-webkit-user-select: none;
padding: var(--n-label-padding);
`, [
c('&:empty', {
Expand Down
4 changes: 4 additions & 0 deletions src/date-picker/src/styles/index.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export default c([
min-width: var(--n-scroll-item-width);
height: calc(var(--n-scroll-item-height) * 6);
user-select: none;
-webkit-user-select: none;
`, [
c('&:first-child', `
min-width: calc(var(--n-scroll-item-width) + 4px);
Expand Down Expand Up @@ -261,6 +262,7 @@ export default c([
`),
cE('month-year', `
user-select: none;
-webkit-user-select: none;
flex-grow: 1;
position: relative;
`, [
Expand Down Expand Up @@ -296,6 +298,7 @@ export default c([
`, [
cE('day', `
user-select: none;
-webkit-user-select: none;
line-height: 15px;
width: var(--n-item-size);
text-align: center;
Expand All @@ -314,6 +317,7 @@ export default c([
`, [
cB('date-panel-date', `
user-select: none;
-webkit-user-select: none;
position: relative;
width: var(--n-item-size);
height: var(--n-item-size);
Expand Down
2 changes: 1 addition & 1 deletion src/drawer/demos/enUS/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ I think it is similar with modal, with a bit difference on placement.
```demo
basic.vue
multiple.vue
target.vue
closable.vue
target.vue
slot.vue
scroll.vue
resizable.vue
Expand Down
2 changes: 1 addition & 1 deletion src/drawer/demos/enUS/resizable.demo.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<markdown>
# Adjustable drawer
# Resizable drawer

Remeber to use `default-width` or `default-height` with `resizable`.
</markdown>
Expand Down
2 changes: 1 addition & 1 deletion src/drawer/demos/zhCN/index.demo-entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
```demo
basic.vue
multiple.vue
target.vue
closable.vue
target.vue
slot.vue
scroll.vue
a11y-debug.vue
Expand Down
1 change: 1 addition & 0 deletions src/drawer/src/styles/index.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export default c([
slideInFromBottomTransition(),
cM('unselectable', `
user-select: none;
-webkit-user-select: none;
`),
cM('native-scrollbar', [
cB('drawer-content-wrapper', `
Expand Down
2 changes: 2 additions & 0 deletions src/form/src/styles/form-item.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ export default cB('form-item', {
`, [
cE('asterisk', `
user-select: none;
-webkit-user-select: none;
color: var(--n-asterisk-color);
transition: color .3s var(--n-bezier);
`),
cE('asterisk-placeholder', `
user-select: none;
-webkit-user-select: none;
visibility: hidden;
`)
]),
Expand Down
1 change: 1 addition & 0 deletions src/image/src/styles/index.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ export default c([
]),
cB('image-preview', `
user-select: none;
-webkit-user-select: none;
pointer-events: all;
margin: auto;
max-height: calc(100vh - 32px);
Expand Down
1 change: 1 addition & 0 deletions src/input/src/styles/input-group-label.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { cB, cE } from '../../../_utils/cssr'
export default cB('input-group-label', `
position: relative;
user-select: none;
-webkit-user-select: none;
box-sizing: border-box;
padding: 0 12px;
display: inline-block;
Expand Down
1 change: 1 addition & 0 deletions src/pagination/src/styles/index.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export default cB('pagination', `
position: relative;
cursor: pointer;
user-select: none;
-webkit-user-select: none;
display: flex;
align-items: center;
justify-content: center;
Expand Down
1 change: 1 addition & 0 deletions src/radio/src/styles/radio-group.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ export default cB('radio-group', `
outline: none;
position: relative;
user-select: none;
-webkit-user-select: none;
display: inline-block;
box-sizing: border-box;
padding-left: 14px;
Expand Down
1 change: 1 addition & 0 deletions src/radio/src/styles/radio.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export default cB('radio', `
outline: none;
position: relative;
user-select: none;
-webkit-user-select: none;
display: inline-flex;
align-items: flex-start;
flex-wrap: nowrap;
Expand Down
1 change: 1 addition & 0 deletions src/slider/src/styles/index.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export default c([
width: 100%;
cursor: pointer;
user-select: none;
-webkit-user-select: none;
`, [
cM('reverse', [
cB('slider-handles', [
Expand Down
1 change: 1 addition & 0 deletions src/spin/src/styles/index.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export default c([
`, [
cM('spinning', `
user-select: none;
-webkit-user-select: none;
pointer-events: none;
opacity: var(--n-opacity-spinning);
`)
Expand Down
1 change: 1 addition & 0 deletions src/switch/src/styles/index.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default cB('switch', `
min-width: var(--n-width);
vertical-align: middle;
user-select: none;
-webkit-user-select: none;
display: inline-flex;
outline: none;
justify-content: center;
Expand Down
5 changes: 4 additions & 1 deletion src/watermark/src/styles/index.cssr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ export default c([
cB('watermark-container', `
position: relative;
`, [
cNotM('selectable', 'user-select: none;')
cNotM('selectable', `
user-select: none;
-webkit-user-select: none;
`)
]),
cB('watermark', `
position: absolute;
Expand Down

0 comments on commit 1e7bb4a

Please sign in to comment.