@attr boolean/number setter function called with an empty string (v2-beta)
還沒有人認領這個 Issue。
評估
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 新手友好度
- 45/100
- Issue 類型
- 缺陷
- 描述清晰度
- 基本清楚
- 活躍度
- 停滯
- 技術堆疊
- typescript
- 領域
- frontend
研究方向
從 @attr 裝飾器進入點開始,使用 issue 中的 TypeScript 元件和 HTML 程式碼片段重現該行為。追蹤缺少 boolean-prop 屬性時的 setter 呼叫,並將其與存在初始值時的呼叫進行比較。當預期的 setter 行為已確立,並由適當的測試涵蓋或記錄為限制時,即表示完成。
由索引模型根據 Issue 內容生成。
描述
This is maybe related to #117, but not 100% sure on that.
With a component defined like this:
import { controller, attr } from '@github/catalyst'
@controller
class TestComponentElement extends HTMLElement {
@attr get booleanProp() {
return false
}
set booleanProp( _v: boolean ) {
console.dir( `booleanProp type: ${ typeof _v }` )
console.dir( `booleanProp value: '${ _v }'` )
}
connectedCallback() {
this.booleanProp = true
}
}
and html like this (note the lack of an initial boolean-prop value):
<test-component></test-component>
I get these log messages:
booleanProp type: boolean
booleanProp value: 'true'
booleanProp type: string
booleanProp value: ''
Changing the html to include an initial value like this:
<test-component boolean-prop='anything'></test-component>
get's rid of that final empty string call:
booleanProp type: boolean
booleanProp value: 'true'
Maybe this is a limitation? Hopefully this isn't another ghost bug, sorry about the last one 🫣
- 主要語言
- TypeScript
- 星號
- 1.4k
- 分支
- 61
- 平均合併
- 1 天 15 小時
- 30 天內合併 PR
- 8
環境準備
在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。
- 沒有 Dockerfile 或 Docker Compose 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
github/catalyst 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 78/100
-
難度 3/5 1-2 天 新手友好度 62/100
-
難度 5/5 一週以上 新手友好度 20/100
-
難度 5/5 一週以上 新手友好度 25/100
-
難度 3/5 1-2 天 新手友好度 42/100
相似的 Issue
-
normalizePropName strips `#` characters from Figma property names instead of only the `#id` suffix未關閉
難度 2/5 1-3 小時 新手友好度 72/100
figma/code-connect#419 ·
-
bug
難度 2/5 1-3 小時 新手友好度 70/100
jeanibarz/knowledge-base-mcp-server#1268 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 78/100
Koenkk/zigbee-herdsman-converters#13820 ·
維護者通常 2 天內回覆
-
A live recovery copy treats a large whole number and text with the same digits as the same value未關閉bug sharing & sync
難度 2/5 1-3 小時 新手友好度 64/100
維護者通常 1 天內回覆
-
[prefer-expect-resolves] autofix leaves a stray ")" when the awaited expression is parenthesized未關閉
難度 2/5 1-3 小時 新手友好度 78/100
jest-community/eslint-plugin-jest#2052 ·