Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

New answers tagged

1 vote
Accepted

LWC - Check checkbox won't work

In connectedCallback(), the child elements haven't been rendered yet. You need to wait a tick, either by renderedCallback or by Promise.resolve: // option 1 async connectedCallback() { await Promise....
user avatar
  • 430k
3 votes
Accepted

lightning-input checkbox - getting checked rows when submitted

Something like this: let selected = [ ...this.template.querySelectorAll('lightning-input') ].filter((input) => input.checked) .map((input) => input.closest('[data-contact-id]').dataset....
user avatar
  • 430k
3 votes
Accepted

lightning-input checkbox margin-right

Your last screenshot gives it away: margin-right: var(--lwc-spacingXSmall,0.5rem) True, 0.5rem is the default. So set your own --lwc-spacingXSmall: :host { --lwc-spacingXSmall: 0; } It's all ...
user avatar
1 vote
Accepted

LWC - Checkbox keeping data with Previous/Next

As suggested by sfdcfox instead of checkbox radio button is ideal for this scenario. Following answer is just to demonstrate how to maintain state of lwc component in flow when click on Previous and ...
user avatar
  • 1,048
1 vote

LWC - Checkbox keeping data with Previous/Next

First of all, you should consider using a radio instead of a checkbox, since the user can only choose one. Aside from that, you can store the selected values for every page in order to determine which ...
user avatar
  • 430k

Top 50 recent answers are included