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

TASK: Prevent default action when interacting with the dropdown

parent 330a995c
Pipeline #2029 passed with stage
in 1 minute
......@@ -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 }
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment