Skip to content
This repository was archived by the owner on Sep 21, 2021. It is now read-only.

Commit 4b26b2e

Browse files
authored
Merge pull request #487 from devtools-html/more
Show a "more…" label when needed.
2 parents e16da79 + aa6753f commit 4b26b2e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/devtools-reps/src/reps/grip.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ function propIterator(props, object, max) {
128128
// unquoted.
129129
const suppressQuotes = object.class === "Proxy";
130130
let propsArray = getProps(props, properties, indexes, suppressQuotes);
131-
if (Object.keys(properties).length > max) {
131+
if (Object.keys(properties).length > max || propertiesLength > max) {
132132
// There are some undisplayed props. Then display "more...".
133133
propsArray.push(Caption({
134134
object: span({}, "more…")

packages/devtools-reps/src/reps/stubs/grip.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ stubs.set("testMoreThanMaxProps", {
7070
"ownPropertyLength": longModeMaxLength + 1,
7171
"preview": {
7272
"kind": "Object",
73-
"ownProperties": Array.from({length: longModeMaxLength + 1})
73+
"ownProperties": Array.from({length: longModeMaxLength})
7474
.reduce((res, item, index) => Object.assign(res, {
7575
["p" + index]: {
7676
"configurable": true,

0 commit comments

Comments
 (0)