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

Dropdown item weird behavior #64

Open
igdmdimitrov opened this issue Apr 2, 2024 · 0 comments
Open

Dropdown item weird behavior #64

igdmdimitrov opened this issue Apr 2, 2024 · 0 comments
Labels
🐛 bug Something isn't working

Comments

@igdmdimitrov
Copy link

Description

The dropdown item is shifting infinitely down.

Steps to reproduce

import { IgrButton, IgrButtonModule, IgrDropdown, IgrDropdownItem, IgrDropdownItemModule, IgrDropdownModule, IgrRipple, IgrRippleModule } from 'igniteui-react';
import { useRef } from 'react';
import styles from './master-view.module.css';
import createClassTransformer from '../style-utils';

IgrButtonModule.register();
IgrDropdownItemModule.register();
IgrDropdownModule.register();
IgrRippleModule.register();

export default function MasterView() {
  const classes = createClassTransformer(styles);
  const dropdown = useRef<IgrDropdown>(null);

  return (
    <>
      <div className={classes("row-layout master-view-container")}>
        <IgrButton variant="Contained" size="large" clicked={(e: any) => dropdown?.current.toggleTarget(e.target || e.i.nativeElement)} className={classes("button")}>
          <span>Dropdown</span>
          <IgrRipple></IgrRipple>
        </IgrButton>
        <IgrDropdown ref={dropdown} className={classes("dropdown")}>
          <div style={{display: 'contents'}} onClick={(e: any) => dropdown?.current.toggleTarget(e.target || e.i.nativeElement)}>
            <IgrDropdownItem>
              <span>Option</span>
            </IgrDropdownItem>
          </div>
        </IgrDropdown>
      </div>
    </>
  );
}

Result

dropdown react

Expected result

Dropdown should close

@igdmdimitrov igdmdimitrov added the 🐛 bug Something isn't working label Apr 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant