Skip to content

Instantly share code, notes, and snippets.

@megasmack
megasmack / README.md
Last active Jan 5, 2023
LWC/Apex Retrieve User Debug Mode Console Logs
View README.md

LWC/Apex User Debug Mode Console Logs

Using the Debug Mode setting in the running User to send debug console logs to the Inspector for Lightning Web Components.

If you need to override the debug behavior, you can change the userDebugMode sessionStorage property to 'true'. You might need to do this to get logs for Guest users that do not have a Debug Mode.

@megasmack
megasmack / README.md
Last active May 24, 2022
LWC Focus-Trapping Modal
View README.md

LWC Focus-Trapping Modal

Using SLDS classes, build a modal Lightning Web Component that has focus-trapping for accessiblity.

Notes: The shadowdom presents some challenges with creating focus-trapping within modals. Making creating a reusable component tricky. So instead we can create a modal utility file with all our methods to keep things as DRY as possible.

@megasmack
megasmack / README.md
Created May 11, 2022
Remove orphans from text string
View README.md

Remove orphans from text string

Take the last word of text string and replace the space before it with a non-breaking space.

@megasmack
megasmack / README.md
Last active May 11, 2022
LWC Dependent Pick List Example
View README.md

LWC Dependent Pick List Example

An example of working with Salesforce Dependant Picklists in LWC using the uiObjectInfoApi. The juicy bit is in the method setDependentPicklist on line 61 of countrySateSelector.js.