<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: venkata srikanth</title>
    <description>The latest articles on DEV Community by venkata srikanth (@venkatasrikanthkarri).</description>
    <link>https://dev.to/venkatasrikanthkarri</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F470060%2F6de29b80-7764-4852-8f53-27db8e182338.jpeg</url>
      <title>DEV Community: venkata srikanth</title>
      <link>https://dev.to/venkatasrikanthkarri</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/venkatasrikanthkarri"/>
    <language>en</language>
    <item>
      <title>The listener function is not registered in the functional components</title>
      <dc:creator>venkata srikanth</dc:creator>
      <pubDate>Wed, 13 Jul 2022 07:08:54 +0000</pubDate>
      <link>https://dev.to/venkatasrikanthkarri/the-listener-function-is-not-registered-in-the-functional-components-md</link>
      <guid>https://dev.to/venkatasrikanthkarri/the-listener-function-is-not-registered-in-the-functional-components-md</guid>
      <description>&lt;h1&gt;
  
  
  react
&lt;/h1&gt;

&lt;p&gt;Using Functional Component, I am trying to find the scroll position of an element, but the listener function isn't registering as scrolling occurs. Can anyone explain why this is happening.&lt;/p&gt;

&lt;p&gt;Here is the code for reference&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;export default function App() {
  const [scrollPosition, setScrollPOsition] = useState(0);
  const innerRef = useRef&amp;lt;HTMLParagraphElement&amp;gt;(null);

  const handleScroll = () =&amp;gt; {
    console.log("handle scroll");
    // setScrollPOsition((scrollPosition) =&amp;gt; scrollPosition + 1);
  };

  useEffect(() =&amp;gt; {
    if (innerRef.current) {
      innerRef.current.addEventListener("scroll", handleScroll);
      return () =&amp;gt; innerRef.current?.addEventListener("scroll", handleScroll);
    }
  }, []);

  return (
    &amp;lt;div className="App"&amp;gt;
      &amp;lt;span className={"scrollValue"}&amp;gt;
        scroll position of first header: {scrollPosition}
      &amp;lt;/span&amp;gt;
      &amp;lt;h1 ref={innerRef}&amp;gt;Find My position on window&amp;lt;/h1&amp;gt;
      &amp;lt;h2&amp;gt;Heading Element&amp;lt;/h2&amp;gt;
      ...
      ...
      &amp;lt;h2&amp;gt;Heading Element&amp;lt;/h2&amp;gt;
    &amp;lt;/div&amp;gt;
  );
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is the code sandbox &lt;a href="https://codesandbox.io/s/finding-the-scroll-position-of-an-element-osk650?file=/src/App.tsx:2705-2722"&gt;link&lt;/a&gt;&lt;/p&gt;

</description>
      <category>addeventlistener</category>
      <category>react</category>
      <category>javascript</category>
      <category>reacthooks</category>
    </item>
    <item>
      <title>Why css `-webkit-mask-box-image` is not applying after adding overflow:hidden to its parent?</title>
      <dc:creator>venkata srikanth</dc:creator>
      <pubDate>Tue, 21 Dec 2021 06:08:34 +0000</pubDate>
      <link>https://dev.to/venkatasrikanthkarri/why-css-webkit-mask-box-image-is-not-applying-after-adding-overflowhidden-to-its-parent-2i1c</link>
      <guid>https://dev.to/venkatasrikanthkarri/why-css-webkit-mask-box-image-is-not-applying-after-adding-overflowhidden-to-its-parent-2i1c</guid>
      <description>&lt;p&gt;I am trying to achieve linear blur on a card as shown in the following&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--UylEodMq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pk0shnvewat55u03ippk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--UylEodMq--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pk0shnvewat55u03ippk.png" alt="Image description" width="385" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;linear-blur is applied with the following CSS properties&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.app-container {
  position: relative;
  background: url("https://res.cloudinary.com/dmwrugc6z/image/upload/v1639725427/wallhaven-lq1ezq_blo0mr.jpg");
  background-size: cover;
  border-radius: 24px;
  margin: auto;
  width: 328px;
  height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
}

.blur-background {
  height: 144px;
  position: absolute;
  left: 0;
  right: 0;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(20px);
  -webkit-mask-box-image: linear-gradient(to top, black, black, transparent);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After adding &lt;code&gt;overflow:hidden;&lt;/code&gt; &lt;code&gt;-webkit-mask-box-image&lt;/code&gt; property is not applying, any reason for this weird behaviour?&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;.app-container {
  position: relative;
  background: url("https://res.cloudinary.com/dmwrugc6z/image/upload/v1639725427/wallhaven-lq1ezq_blo0mr.jpg");
  background-size: cover;
  border-radius: 24px;
  margin: auto;
  width: 328px;
  height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  overflow:hidden;
}

.blur-background {
  height: 144px;
  position: absolute;
  left: 0;
  right: 0;
  border-bottom-left-radius: 24px;
  border-bottom-right-radius: 24px;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(20px);
  -webkit-mask-box-image: linear-gradient(to top, black, black, transparent);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The blur is not masking as shown in the below&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--j_sMK6E9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cqlu9d4u6c24okn74azi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--j_sMK6E9--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cqlu9d4u6c24okn74azi.png" alt="Image description" width="400" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;you can find the source code here: &lt;a href="https://codesandbox.io/s/linear-blur-issue-vdjw7?file=/src/styles.css"&gt;https://codesandbox.io/s/linear-blur-issue-vdjw7?file=/src/styles.css&lt;/a&gt;&lt;/p&gt;

</description>
      <category>css</category>
      <category>html</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
