Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to disable row collapse when clicking anywhere on the window #255

Open
cardinalpipkin opened this issue Apr 8, 2024 · 0 comments
Open

Comments

@cardinalpipkin
Copy link

I have a problem when a user clicks to expand a row, it does so, but if the user clicks away from the collapsible component, (anywhere within the window) it will collapse the row. Is this intentional?


  const getAssociatedSitesForCollapsible = (hubSite: any, i: any) => {
    setExpandedHubSiteIndex(i);
    setSelectedHubSiteUrl(hubSite);
    if (i === expandedHubSite) {
      setExpandedHubSite(null);
    }
    else {
      setExpandedHubSite(i);
    }
    const filterTheAssociatedSites = unfilteredSites.filter((hub) => {
      return hubSite === hub.Hub
    });
    setAssociatedSites(filterTheAssociatedSites);
  };


{topLevelHubSites.map((element, i) => (
        <Collapsible
          // triggerDisabled={showMembersDataCard}
          trigger={
            <table className={styles.hubsites}>
              <tr >
                <td>
                  <Stack >
                  ...
                  </Stack>
                </td>
              </tr>
            </table>
          }
          key={i}
          open={expandedHubSite === i}
          onClose={onCollapse}
          onOpening={() => getAssociatedSitesForCollapsible(element.Hub, i)}
          transitionTime={200}
        >
          {associatedSites.length > 0 ? associatedSites.map((assSite: any, key) => {
            return (
              <table key={key} className={styles.associatedSites}>
                <tr>
                  <td>
                    {assSite.SiteUrl.substring(assSite.SiteUrl.lastIndexOf('/') + 1)}
                  </td>
                  <td className={styles.tdTools}>
                    <IconButton
                      iconProps={people}
                      onClick={() => handleMembersDataCard(element.Hub, i)}
                      ref={clickedHubPersonIcon}
                    />
                  </td>
                </tr>
              </table>)
          }) : null}
        </Collapsible>
      ))}

How can I stop this from happening? I've used triggerDisabled property but it doesn't work as intended.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant