Skip to content

Commit d64268f

Browse files
Merge pull request salesforce#1442 from vernak2539/remove-js-void-from-tree
Update Tree branch and item to use new SLDS HTML tags
2 parents f0698aa + 7a27c37 commit d64268f

12 files changed

+2550
-3817
lines changed

components/tree/private/branch.jsx

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -310,17 +310,17 @@ const renderBranch = (children, props) => {
310310
tabIndex="-1"
311311
/>
312312
{/* eslint-disable no-script-url */}
313-
<a
314-
id={`${props.htmlId}__label`}
315-
href="javascript:void(0)"
316-
// eslint-disable-next-line jsx-a11y/no-interactive-element-to-noninteractive-role
317-
role="presentation"
318-
className="slds-truncate"
319-
tabIndex="-1"
320-
>
313+
<span className="slds-size_1-of-1" id={`${props.htmlId}__label`}>
321314
{/* eslint-enable no-script-url */}
322-
{<Highlighter search={props.searchTerm}>{props.label}</Highlighter>}
323-
</a>
315+
{
316+
<Highlighter
317+
search={props.searchTerm}
318+
className="slds-tree__item-label slds-truncate"
319+
>
320+
{props.label}
321+
</Highlighter>
322+
}
323+
</span>
324324
</div>
325325
{isLoading ? loader : null}
326326
<ul

components/tree/private/item.jsx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -174,16 +174,15 @@ const Item = (props) => {
174174
disabled
175175
/>
176176
{/* eslint-disable no-script-url */}
177-
<a
178-
tabIndex="-1"
179-
href="javascript:void(0)"
180-
// eslint-disable-next-line jsx-a11y/no-interactive-element-to-noninteractive-role
181-
role="presentation"
182-
className="slds-truncate"
183-
>
177+
<span className="slds-size_1-of-1">
184178
{/* eslint-enable no-script-url */}
185-
<Highlighter search={props.searchTerm}>{props.label}</Highlighter>
186-
</a>
179+
<Highlighter
180+
search={props.searchTerm}
181+
className="slds-tree__item-label slds-truncate"
182+
>
183+
{props.label}
184+
</Highlighter>
185+
</span>
187186
</div>
188187
</li>
189188
);

0 commit comments

Comments
 (0)