Hot answers tagged

3 votes
Accepted

Set the color of a value in lwc

You have a few choices. Option 1 is to set the entire style: <div style={style}>{item}</div> Which is set in JavaScript: this.style = `color: ${data.itemColor}`; Option 2 is to set a CSS ...
user avatar
  • 434k
1 vote
Accepted

Before After LWC Slider

LWC doesn't work quite the same as vanilla JavaScript. I'd recommend that you attach an event listener directly to the slider, then handle the event. <input type="range" min=&...
user avatar
  • 434k
1 vote

change color of lighning button in JS not working

Lightning Web Components currently enforces shadow DOM on every component, encapsulating a component’s internal markup and making it inaccessible to CSS, HTML or JS. More about this here: https://...
user avatar
  • 34
1 vote

change color of lighning button in JS not working

Like all lightning components, you cannot mess with the styling of the component's internals in this way because their content is protected within a Shadow DOM. You have to use the features provided, ...
user avatar
  • 27.4k
1 vote
Accepted

Conditionally disable button in LWC Datatable

disabled: {fieldName: 'PID' == this.projectId.data} Is incorrect. You need to specify the field: disabled: { fieldName: 'tacticsDisabled' }, Which you then apply to each row: this.accList = this....
user avatar
  • 434k
1 vote

Why can't I get rid of the 'X' button on my LWC Modal? I have a 'Cancel' lightning button so the 'X' is not needed

lightning__RecordAction with actionType set to ScreenAction provides a modal for you. You don't need to use SLDS modal markup when you use this type. See lightning-quick-action-panel for an example of ...
user avatar
  • 434k
1 vote
Accepted

Lightning web component causing refresh loop

You have your structure wrong, it seems. Your wire doesn't return the data, but rather a response which itself has a data attribute. Renaming would help clarify things, and then you need to figure out ...
user avatar
  • 143k

Only top scored, non community-wiki answers of a minimum length are eligible