瀏覽代碼

fix: Wrap excalidraw in position relative & hide scrollbars in zen mode (#3174)

* fix: wrap excalidraw in position relative so that host need not add it explicitly to fix positioning when non zero offsets

* patch version

* Hide scrollbars on excalidraw container

* remove overflow hidden from index.html since its handled in excalidraw container

* review fix

* update changelog
vanilla_orig
Aakansha Doshi 4 年之前
父節點
當前提交
eb24e8ffe4
沒有連結到貢獻者的電子郵件帳戶。
共有 5 個檔案被更改,包括 12 行新增7 行删除
  1. 0
    1
      public/index.html
  2. 0
    4
      src/components/App.tsx
  3. 2
    0
      src/css/styles.scss
  4. 9
    1
      src/packages/excalidraw/CHANGELOG.md
  5. 1
    1
      src/packages/excalidraw/package.json

+ 0
- 1
public/index.html 查看文件

116
         user-select: none;
116
         user-select: none;
117
         width: 100vw;
117
         width: 100vw;
118
         height: 100vh;
118
         height: 100vh;
119
-        overflow: hidden;
120
       }
119
       }
121
 
120
 
122
       .visually-hidden {
121
       .visually-hidden {

+ 0
- 4
src/components/App.tsx 查看文件

414
       zenModeEnabled,
414
       zenModeEnabled,
415
       width: canvasDOMWidth,
415
       width: canvasDOMWidth,
416
       height: canvasDOMHeight,
416
       height: canvasDOMHeight,
417
-      offsetTop,
418
-      offsetLeft,
419
       viewModeEnabled,
417
       viewModeEnabled,
420
     } = this.state;
418
     } = this.state;
421
 
419
 
433
         style={{
431
         style={{
434
           width: canvasDOMWidth,
432
           width: canvasDOMWidth,
435
           height: canvasDOMHeight,
433
           height: canvasDOMHeight,
436
-          top: offsetTop,
437
-          left: offsetLeft,
438
         }}
434
         }}
439
       >
435
       >
440
         <LayerUI
436
         <LayerUI

+ 2
- 0
src/css/styles.scss 查看文件

8
 }
8
 }
9
 
9
 
10
 .excalidraw {
10
 .excalidraw {
11
+  position: relative;
12
+  overflow: hidden;
11
   color: var(--text-primary-color);
13
   color: var(--text-primary-color);
12
   display: flex;
14
   display: flex;
13
   top: 0;
15
   top: 0;

+ 9
- 1
src/packages/excalidraw/CHANGELOG.md 查看文件

12
 Please add the latest change on the top under the correct section.
12
 Please add the latest change on the top under the correct section.
13
 -->
13
 -->
14
 
14
 
15
-## Unreleased
15
+## 0.4.2
16
 
16
 
17
 ## Excalidraw API
17
 ## Excalidraw API
18
 
18
 
19
 ### Fixes
19
 ### Fixes
20
 
20
 
21
+- Wrap excalidraw in position relative so host need not do it anymore & hide scrollbars in zen mode [#3174](https://github.com/excalidraw/excalidraw/pull/3174).
21
 - Reduce the scroll debounce timeout to `100ms` so `offsets` gets updated faster if changed when container scrolled [#3182](https://github.com/excalidraw/excalidraw/pull/3182).
22
 - Reduce the scroll debounce timeout to `100ms` so `offsets` gets updated faster if changed when container scrolled [#3182](https://github.com/excalidraw/excalidraw/pull/3182).
23
+- Rerender UI on `renderFooter` prop change [#3183](https://github.com/excalidraw/excalidraw/pull/3183)
24
+
25
+## Excalidraw Library
26
+
27
+### Fixes
28
+
29
+- Temporarily downgrade browser-fs-access to fix legacy FS API [#3172](https://github.com/excalidraw/excalidraw/pull/3172)
22
 
30
 
23
 ---
31
 ---
24
 
32
 

+ 1
- 1
src/packages/excalidraw/package.json 查看文件

1
 {
1
 {
2
   "name": "@excalidraw/excalidraw",
2
   "name": "@excalidraw/excalidraw",
3
-  "version": "0.4.1",
3
+  "version": "0.4.2",
4
   "main": "dist/excalidraw.min.js",
4
   "main": "dist/excalidraw.min.js",
5
   "files": [
5
   "files": [
6
     "dist/*"
6
     "dist/*"

Loading…
取消
儲存