Commit 01f357ab authored by Dominique Feyer's avatar Dominique Feyer
Browse files

TASK: Prevent default action when interacting with the dropdown

parent 330a995c
Loading
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -12,13 +12,14 @@ export class DropdownItem {
  @Prop() icon: string;
  @Prop() iconType: string = 'solid';

  neosItemSelectedHandler() {
  neosItemSelectedHandler(e) {
    e.preventDefault();
    this.neosItemSelected.emit(this.label);
  }

  render() {
    return (
      <a href="#" class="dropdown-item" onClick={() => this.neosItemSelectedHandler()}>
      <a href="#" class="dropdown-item" onClick={(e) => this.neosItemSelectedHandler(e)}>
        { this.icon ? <div class="icon">
          <neos-icon name={this.icon} type={this.iconType}/>
        </div> : null }
+3 −2
Original line number Diff line number Diff line
@@ -25,7 +25,8 @@ export class Dropdown {
    this.activeLabel = this.selectedLabel;
  }

  toggle() {
  toggle(e) {
    e.preventDefault();
    this.isOpen = !this.isOpen;
  }

@@ -40,7 +41,7 @@ export class Dropdown {
          <slot name="metadata"/>
        </neos-form-input-label>
        <div class={this.wrapperClassName()}>
          <a href="#" class="dropdown" onClick={() => this.toggle()}>
          <a href="#" class="dropdown" onClick={(e) => this.toggle(e)}>
            <div class="icon">
              <neos-icon name="file"/>
            </div>