-
-
Notifications
You must be signed in to change notification settings - Fork 72
Conversation
storiesOf('DashTable/CSS override', module) | ||
.add('css with escaped id', () => (<DataTable | ||
setProps={setProps} | ||
id={'`~!@#$%^&*()=+ \\|/.,:;\'"`?[]<>{}'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without the fix, the table does not render and throws.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
leading to the developer screaming "~!@#$%^&*()=+ \|/.,:;'"`?[]<>{}"
/>)) | ||
.add('stringified object as id', () => (<DataTable | ||
{...props} | ||
id={{ id: 3, group: 'A' }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FWIW you're never going to actually get an object sent to the component by the renderer as an id
- the renderer stringifies the id first, and does so as sorted JSON, so you'll get '{"group":"A","id":3}'
Does DataTable
separately stringify ids? Because if I just call CSS.escape
on an object it just gives "\[object\ Object\]"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does DataTable separately stringify ids?
Oups.
41981cb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small test question #766 (comment) otherwise this looks great! Nice and easy. 💃
Closes #765
Escapes typical problematic characters that can be used for
id
and that need to be escaped for CSS selector.