Closed kandrelczyk closed 1 week ago
I think it's a bit weird that the Dropdown popup doesn't close when clicking on the DropdownItem. Also, I think it would be better to remove the click event of the DropdownItem and add an on_select event to the Dropdown instead. https://www.naiveui.com/en-US/os-theme/components/dropdown#basic.vue
Please take a look at this. Since we don't want to close the dropdown when clicking on disabled item I had to keep the previous closing method and add automatic close when on_select is called.
In previous commit I also introduced the call_on_click_outside
method which is a common code between dropdown and popover but forgot to extract it. Now it's in utils and can be also used in future popselect and popconfirm components.
Let me know what you think. If this is fine I will update documentation.
The call_on_click_outside
method is fine, but there are a few hiccups at the moment. https://github.com/thaw-ui/thaw/pull/210#discussion_r1651876253
I think that's it. Demo page is also updated. Let me know if anything still needs fixing.
Adding dropdown component. For now it's just a basic list with optional icon and disabled option.