-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add data attribute to checkbox #1449
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
Bom atualizar os testes em react/components/Checkbox/index.test.js
para ter pelo menos um usando essa prop nova.
queryText: PropTypes.string, | ||
facetKey: PropTypes.string, | ||
queryCategory: PropTypes.string, | ||
isClicked: PropTypes.string |
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.
Qual o cenário onde o isClicked
é necessário se existe o checked
e o onChange?
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.
Nós vamos coletar os dados da tag html usando activity-flow. O atributo "checked", apesar de ter a informação que queremos, determina somente a aparência do checkbox e não consta no HTML (como mostrado na imagem abaixo). Portanto, para conseguir coletar a informação se o usuário está acionando ou desativando um facet, nós precisamos desse atributo isClicked.

What is the purpose of this pull request?
Adding the following data attribute to the checkbox component for collection data on activity-flow.
This attributes are specifically added for usage
Types of changes
How to test this change?
Download this project and link it on VTEX IO to an account that uses the checkbox component.
(I am using hering, testing the filter's checkbox)
Create your project with the checkbox component — or download one that already uses it — and link it to VTEX IO.
(I am using the search-result react app and altering the FacetItem component)
Add the desired attributes within the checkbox component following the template:
!!! Important information !!!
All values should be of type String
Example of full code:
