Salesforce Platform Developer I (legacy) — Question 284
Which Lightning Web Component custom event property settings enable the event to bubble up the containment hierarchy and cross the Shadow DOM boundary?
Answer options
- A. bubbles: true, composed: false
- B. bubbles: true, composed: true
- C. bubbles: false, composed: false
- D. bubbles: false, composed: true
Correct answer: B
Explanation
The correct answer is B because setting both bubbles to true and composed to true allows the event to travel up the containment hierarchy and cross the Shadow DOM. Options A, C, and D do not enable both properties, which limits the event's ability to bubble or cross the Shadow DOM as required.