Can Custom Object Formatters support a [show more...] UI?

96 views
Skip to first unread message

Tom MacWright

unread,
Nov 13, 2017, 2:48:18 AM11/13/17
to Google Chrome Developer Tools
Hello!

I'm working on implementing custom formatters for new JavaScript datatypes, largely basing my knowledge off of the lovely 'Custom Object Formatters in Chrome DevTools' article. I'm seeing how the nesting of objects works well, but I'm trying to replicate the experience of Chrome's default formatters for Arrays and TypeArrays: if the input object has more than, say, 100 items, it'll show an ellipsis and offer to Show more.... Would love any ideas about how this might be possible with the current API, or if it isn't, or if it isn't now and might be someday.

Thanks,

- Tom

Kayce Basques

unread,
Nov 16, 2017, 6:53:23 PM11/16/17
to Google Chrome Developer Tools
So, you want to specify when contents are hidden behind an ellipsis and the Show More button is shown?

Also, you're saying that it doesn't automatically do this for you when your object hits 100 items (for example)?

Tom MacWright

unread,
Nov 24, 2017, 7:59:50 PM11/24/17
to Google Chrome Developer Tools
Yep, that's the intent, and yep, as far as I can tell, custom object formatters do not automatically truncate, ever. To be clear, the default built-in formatters work as intended: this is only about custom object formatters.

Here's a testcase - immutable-devtools, when you console.log() an Immutable.List with 1,000 items, it displays all 1,000. Is it possible, given the custom object formatter API, to truncate this list by default, like the default object formatters do?

Paul Irish

unread,
Nov 30, 2017, 5:44:03 PM11/30/17
to Google Chrome Developer Tools, Erik Luo
+luoe, wdyt?

--
You received this message because you are subscribed to the Google Groups "Google Chrome Developer Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-chrome-developer-tools+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-chrome-developer-tools/21d891f5-52d8-4118-b050-da292f97827f%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages