Closed
Bug 1276206
Opened 9 years ago
Closed 8 years ago
Reps: If a grip/object's property name is "more", it is clobbers the caption
Categories
(DevTools :: Shared Components, defect, P1)
DevTools
Shared Components
Tracking
(firefox52 fixed)
Tracking | Status | |
---|---|---|
firefox52 | --- | fixed |
People
(Reporter: linclark, Assigned: Honza)
References
Details
(Whiteboard: [reserve-html])
Attachments
(1 file, 2 obsolete files)
(deleted),
patch
|
linclark
:
review+
|
Details | Diff | Splinter Review |
Because Reps use the key "more" for captions, they will collide with any properties named more.
For example, if you have the following object:
> `{a: "a", b: "b", more: "c", d: "d", e: "e"}`
The output would be:
> `{a: "a", b: "b", more: "c"}`
But it should be:
> `{a: "a", b: "b", more: "c", more...}`
Reporter | ||
Updated•9 years ago
|
Priority: -- → P1
Summary: If a grip/object's property name is "more", it is clobbers the caption → Reps: If a grip/object's property name is "more", it is clobbers the caption
Whiteboard: [devtools-html] [triage]
Reporter | ||
Comment 1•9 years ago
|
||
Removing the key is fine in this case. React will use its default, which is the array index of the Caption element. The "more..." caption should never be at a different position in the array, so using index as the key should have the same effect.
Assignee | ||
Comment 2•9 years ago
|
||
Comment on attachment 8757279 [details] [diff] [review]
Bug1276206.patch
Review of attachment 8757279 [details] [diff] [review]:
-----------------------------------------------------------------
Good catch!
Honza
Attachment #8757279 -
Flags: review?(odvarko) → review+
Assignee | ||
Comment 3•9 years ago
|
||
Hm... I am now seeing:
"Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `Grip`. See https://fb.me/react-warning-keys for more information."
Honza
Updated•9 years ago
|
Blocks: 1257552, devtools-html-2
Updated•9 years ago
|
Iteration: --- → 49.3 - Jun 6
Flags: qe-verify-
Whiteboard: [devtools-html] [triage] → [devtools-html]
Reporter | ||
Comment 4•9 years ago
|
||
I realized that if we move the caption out of the array and just pass it in directly in the children arguments, as a sibling to props, then we won't get the warning.
Honza, what would you think of an approach like this? Not fully implemented yet, just wanted to get your feedback first.
Attachment #8757279 -
Attachment is obsolete: true
Attachment #8757319 -
Flags: feedback?(odvarko)
Assignee | ||
Comment 5•9 years ago
|
||
(In reply to Lin Clark [:linclark] from comment #4)
> Created attachment 8757319 [details] [diff] [review]
> Bug1276206.patch
>
> I realized that if we move the caption out of the array and just pass it in
> directly in the children arguments, as a sibling to props, then we won't get
> the warning.
>
> Honza, what would you think of an approach like this? Not fully implemented
> yet, just wanted to get your feedback first.
Interesting, I didn't know keys work that way.
Anyway, works for me.
Honza
Assignee | ||
Updated•8 years ago
|
Attachment #8757319 -
Flags: feedback?(odvarko) → feedback+
Updated•8 years ago
|
Iteration: 49.3 - Jun 6 → 50.1
Updated•8 years ago
|
Assignee: lclark → nobody
Status: ASSIGNED → NEW
Iteration: 50.1 → ---
Priority: P1 → P2
Comment 6•8 years ago
|
||
I would like to work on this. Can Someone help me where to start?
Reporter | ||
Comment 7•8 years ago
|
||
I have a patch up for this that I just have to apply a few changes to. Sorry that wasn't clearer, I didn't realize that my assignment to myself had been removed.
Another issue that would probably be good is this one: https://bugzilla.mozilla.org/show_bug.cgi?id=1264686
Reporter | ||
Updated•8 years ago
|
Assignee: nobody → lclark
Comment 8•8 years ago
|
||
(In reply to Lin Clark [:linclark] from comment #7)
> I have a patch up for this that I just have to apply a few changes to. Sorry
> that wasn't clearer, I didn't realize that my assignment to myself had been
> removed.
>
> Another issue that would probably be good is this one:
> https://bugzilla.mozilla.org/show_bug.cgi?id=1264686
That depends on some other bug can you give me a good bug similar but free to take?
Updated•8 years ago
|
Status: NEW → ASSIGNED
Iteration: --- → 51.1 - Aug 15
Priority: P2 → P1
Updated•8 years ago
|
Iteration: 51.1 - Aug 15 → 51.2 - Aug 29
Updated•8 years ago
|
Iteration: 51.2 - Aug 29 → ---
Priority: P1 → P3
Whiteboard: [devtools-html] → [reserve-html]
Updated•8 years ago
|
Status: ASSIGNED → NEW
Updated•8 years ago
|
Assignee: lclark → odvarko
Status: NEW → ASSIGNED
Iteration: --- → 52.1 - Oct 3
Priority: P3 → P1
Reporter | ||
Comment 9•8 years ago
|
||
Honza, if you're working on this be advised there's an easier way to handle this.
What you can do is use the rest syntax, e.g. ...values, to turn from an array to individual children. Then you don't need keys. As long as we aren't reordering any children, I think this is the best solution
Assignee | ||
Comment 10•8 years ago
|
||
(In reply to Lin Clark [:linclark] from comment #9)
> Honza, if you're working on this be advised there's an easier way to handle
> this.
>
> What you can do is use the rest syntax, e.g. ...values, to turn from an
> array to individual children. Then you don't need keys. As long as we aren't
> reordering any children, I think this is the best solution
Nice, I've done it that way.
- Object rep fixed + test updated.
- Grip rep fixed + test updated.
- Array/GripArray also changed, but just to make the code a bit more consistent. These reps don't have the problem (that's way there are no tests for these two).
Try push:
https://treeherder.mozilla.org/#/jobs?repo=try&revision=7b96ea37cd4b
Honza
Attachment #8757319 -
Attachment is obsolete: true
Attachment #8795312 -
Flags: review?(lclark)
Updated•8 years ago
|
Iteration: 52.1 - Oct 3 → 52.2 - Oct 17
Reporter | ||
Comment 11•8 years ago
|
||
Comment on attachment 8795312 [details] [diff] [review]
bug1276206.patch
Review of attachment 8795312 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good to me, thanks!
Attachment #8795312 -
Flags: review?(lclark) → review+
Comment 13•8 years ago
|
||
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/fx-team/rev/327bd3387ff6
Avoid caption clobber if more prop exists. r=linclark
Keywords: checkin-needed
Comment 14•8 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
status-firefox52:
--- → fixed
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → Firefox 52
Updated•8 years ago
|
status-firefox49:
affected → ---
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•