Skip to content

Commit

Permalink
fix(code-snippet): remove focus on mulit-line snippet
Browse files Browse the repository at this point in the history
  • Loading branch information
tw15egan committed Jan 29, 2020
1 parent 870e3a7 commit 2f6ce92
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,6 @@
padding: 0 $spacing-03;
}

.#{$prefix}--snippet--single .#{$prefix}--snippet-container,
.#{$prefix}--snippet--multi .#{$prefix}--snippet-container {
@include focus-outline('reset');
}

// Single Line Snippet
.#{$prefix}--snippet--single {
@include bx--snippet;
Expand Down Expand Up @@ -304,6 +299,7 @@

.#{$prefix}--snippet-btn--expand:focus {
@include focus-outline('outline');
border-color: transparent;
}

.#{$prefix}--snippet--expand
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

<div class="{{@root.prefix}}--snippet {{@root.prefix}}--snippet--{{variant}}" {{#is variant "multi"}}
data-code-snippet{{/is}}>
<div class="{{@root.prefix}}--snippet-container" aria-label="Code Snippet Text">
<div {{#is variant "single"}}tabindex="0" {{/is}} class="{{@root.prefix}}--snippet-container"
aria-label="Code Snippet Text">
<pre>
<code>@mixin grid-container {
width: 100%;
Expand Down
2 changes: 2 additions & 0 deletions packages/react/src/components/CodeSnippet/CodeSnippet.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ function CodeSnippet({
return (
<div {...rest} className={codeSnippetClasses}>
<div
role={type === 'single' ? 'textbox' : null}
tabIndex={type === 'single' ? 0 : null}
className={`${prefix}--snippet-container`}
aria-label={ariaLabel || copyLabel || 'code-snippet'}>
<code>
Expand Down

0 comments on commit 2f6ce92

Please sign in to comment.