-
Notifications
You must be signed in to change notification settings - Fork 88
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
Close Actions after Action was clicked #615
Comments
Argh, we deprecated the popover menu. In favour of the actions component. Could you migrate to it? |
Oh, I wasn't aware of this. I will have a look. |
@raimund-schluessler ping me if you need help! But our doc is really awesome now :) |
@skjnldsv Well, the Actions component has the same problem. When I want to close the Actions menu after an Action was clicked, I need to do this from the parent component via the Having it self-contained inside the Actions component (at least optional) would be a huge improvement in my opinion. |
Could you give me a use case on why this is required? |
I have a table and every row has an Actions menu with actions to delete or edit the row. When I click on edit, the table cells show input elements and the input in the first cell is focused automatically. So I can start typing immediately, but the Actions menu is still opened, overlapping the last inputs. Hence, I need to click somewhere to close the menu. Edit: Just as in the files app, clicking rename on a file opens an input and closes the menu. Using |
In case you have a better idea how to do this, let me know :) |
Ah yes, you're right! It totally make sense for those kind of actions! :)
nly the one the user clicked on. So if you only take care of a local open variable and use I actually prefer something like this because it gives the dev more control. If we have this as default in the actions component, it will only apply to either all or none. So if you have actions you want it closed after click, but others you want it to stay opened, you will need to have it per actions anyway, which goes to the same point of implementing a |
I tried exactly this, but none of the popovers will open anymore. This is because the click outside of the other Actions sets the open state to false, it is synced to the parent component and prevents opening every Actions menu. |
@raimund-schluessler Well I'm suggesting one open state per Actions component, so it should not interfer :) |
This becomes really cumbersome and basically impossible when you use the actions in a v-for loop. |
AH yes! Now I get it! How do you suggest we implement this into the components? |
I had the same problem when using |
That would be one option, but creating a wrapper component for the How about we |
I would go for something more specific like But in the other hand, other could benefit from it too even if not in a loop as they won't have to implement their own What do you think ? No other ideas? If not, let's do this! 💪 :) |
Fine with me.
To me, the I will create a PR, so we can discuss on the code if we like it. |
You rock! Thanks for taking over! :) |
PR in #622. |
Was closed with #622. |
I have the following component creating a dropdown with popovermenu items:
I want to close the dropdown when an item is clicked. A simple click handler on the popover-menu doesn't work, because the click is prevented in popover-menu. The alternative could be to implement a two-way sync for
this.open
similar to #278, and closing the menu from the parent component after action is handled, but this gets messy quickly when you have multiple dropdowns in the parent component (you need to track which dropdown is opened).I propose to emit a click event like
this.$emit('clickedAction)
in the popover-menu item which theDropdown
component can process if necessary using `@clickedAction="close".The text was updated successfully, but these errors were encountered: