style icon type 轉換成 image 後再切換成其他 type 後無法即時轉換節點樣式
- Dominant language
- TypeScript
- Stars
- 1.1k
- Forks
- 275
- PR merge metrics
- No merged PRs in 30d
Description
### Describe the bug
- 將 type 設定成 'image' 後,不管把 type 轉換成什麼 ( ex:font ) 都不會在節點上立即切換,都需要刷新頁面,節點的樣式才會改變
### Your Example Website or App
https://stackblitz.com/edit/react-ts-xvqwec?file=index.tsx
### Steps to Reproduce the Bug or Issue
假設節點有三種初始情況
1. 節點無任何style,為空白節點
2. 節點顯示圖片
- type='image'
3. 節點顯示文字
- type='font'
以下測試,在顯示上不會直接改變,但後端的值已經有轉換了
1. 當按下 change to image,應該會將所有節點 style 的 type 轉為 image ,並且換圖片
- type 為 font 的位子會改變
- type 為 image 的圖不會馬上轉換
- 原初無設定 style 的節點也不會改變
2. 當按下 change to icon,應該所有節點會將 type 轉換成 font,並且將 value 的值改成黑色的3
- type 為 font 的會直接改變
- 原初無設定 style 的節點也會直接改變
- type 為 image 的不會轉換
3. 當按下 change,應該所有節點會把 type值拿掉,並且將 value 的值改成空值
- type 為 font 的會直接改變
- 原初無設定 style 的節點也會直接改變
- type 為 image 的不會轉換
### Expected behavior
- 希望當在切換 type 為 image 能夠直接轉換,不需要再將整個 browser 重整
- 當 image 轉換成 font 甚至,無 style 時也能夠 不需重整整個 browser
### Screenshots or Videos
[切換 type 出問題](https://i.imgur.com/PIJVE74.mp4)
### Platform
- OS: [e.g. macOS, Windows, Linux]
- Browser: [e.g. Chrome, Safari, Firefox]
- Version: [e.g. 91.1]
### Additional context
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.