Skip to content

Commit

Permalink
fix: onResize wont debounce handleScroll (#9605)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
jnm2377 and kodiakhq[bot] committed Sep 9, 2021
1 parent f9008be commit cf503d6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions packages/react/src/components/CodeSnippet/CodeSnippet.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import PropTypes from 'prop-types';
import React, { useState, useRef, useEffect, useCallback } from 'react';
import classNames from 'classnames';
import useResizeObserver from 'use-resize-observer/polyfilled';
import debounce from 'lodash.debounce';
import { ChevronDown16 } from '@carbon/icons-react';
import { settings } from 'carbon-components';
import Copy from '../Copy';
Expand Down Expand Up @@ -130,7 +129,7 @@ function CodeSnippet({
(codeContentRef?.current && type === 'multi') ||
(codeContainerRef?.current && type === 'single')
) {
debounce(handleScroll, 200);
handleScroll();
}
},
},
Expand Down

0 comments on commit cf503d6

Please sign in to comment.