Completed
Last Updated: 03 Apr 2025 15:52 by ADMIN
Andrei
Created on: 10 Mar 2025 07:54
Category: KendoReact
Type: Bug Report
0
The state of the buttons does not change when the width of the component is changed.
When I change the width of the component, I expect that the state of the buttons (active/locked) will change depending on the scroll position, but this does not happen. For example, if the component did not scroll and both buttons are locked, then when the width is reduced, they will also remain locked. I think this is a mistake. Is there a way around this problem?
7 comments
ADMIN
Vessy
Posted on: 03 Apr 2025 15:52

Hi,

The reported behavior was is fixed as of version 9.4.1 of the components therefore we are closing this issue.

 

Regards,
Vessy
Progress Telerik

Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

ADMIN
Filip
Posted on: 28 Mar 2025 16:41

Hello, Andrei,

Thank you for the provided example. After further testing and trying various custom implementations I can suggest forcing the TabStrip component to update by triggering a re-render when the container's width changes. This can be done by using a state variable to track the width and updating it through an event listener. Here is a code snippet demonstrating this approach:

    import React, { useState, useEffect } from 'react';
    import { TabStrip, TabStripTab } from '@progress/kendo-react-layout';
    
    const App = () => {
      const [containerWidth, setContainerWidth] = useState(window.innerWidth);
    
      useEffect(() => {
        const handleResize = () => {
          setContainerWidth(window.innerWidth);
        };
    
        window.addEventListener('resize', handleResize);
        return () => window.removeEventListener('resize', handleResize);
      }, []);
    
      return (
        <div style={{ width: containerWidth }}>
          <TabStrip>
            <TabStripTab title="Tab 1">
              <p>Content 1</p>
            </TabStripTab>
            <TabStripTab title="Tab 2">
              <p>Content 2</p>
            </TabStripTab>
          </TabStrip>
        </div>
      );
    };
    
    export default App;
    

    Here is the updated example with the approach used above:

    This workaround may not perfectly replicate the behavior of the fixed version 9.4.1, as it manually triggers a re-render based on window size changes. It should help mitigate the issue temporarily until you can upgrade.

    Please review the approach outlined above and let me know in case the undesired behavior is still observed on your end.

    Regards,

    Filip
    Progress Telerik

    Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

    Andrei
    Posted on: 22 Mar 2025 06:38

    The correct link is to an example of the behavior being discussed

     

    https://stackblitz.com/edit/react-3zy3jnvs-sdemandm?file=package.json

    Andrei
    Posted on: 22 Mar 2025 06:33

    Now I see that this behavior has been fixed in version 9.4.1. Here is an example of what I meant. 

    https://stackblitz.com/edit/react-3zy3jnvs?file=app%2Fapp.tsx,package.json

    When the size of the Splitter was changed, the TabStrip did not adjust to the new dimensions, that is, the scroll buttons did not change their state. In your example based on the latest version, this behavior is not observed. We can't update our packages to the latest version right now, so it would be nice if we could suggest some workaround. Thanks

    ADMIN
    Filip
    Posted on: 21 Mar 2025 19:51

    Hello, Andrei,

    Thank you for the clarification.

    Just to make sure I understand the scenario correctly—does the undesired behavior occur only when the width is changed manually, or does it also happen when the width is fixed to a certain value? I created an example with a set width and the scrollable prop, however I was not able to observe the undersired behavior:

    https://stackblitz.com/edit/react-3zy3jnvs?file=app%2Fapp.tsx

    If the issue is reproduced in the example above can you send me a video which showcases the required steps?

    Regards,
    Filip
    Progress Telerik

    Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!

    Andrei
    Posted on: 17 Mar 2025 06:02
    sorry, I thought I specified the component when filling out the bug report. the problem concerns the TabStrip component if the scrollbable property is set. try changing the width of the container in which the component is drawn and you will see that the state of the scroll buttons does not change.
    ADMIN
    Filip
    Posted on: 14 Mar 2025 15:39

    Hello, Andrei,

    Can you please provide more information on which components you are using? Is the KendoReact Button in a Form or inside the Grid? If possible, can you please send me a runnable example which reproduces the undesired behavior? This will enable me to debug it locally and determine if it is a bug on our side and possibly find a workaround.

    Looking forward to your reply.

    Regards,
    Filip
    Progress Telerik

    Enjoyed our products? Share your experience on G2 and receive a $25 Amazon gift card for a limited time!