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

The select component in popver will autoclose when selete item #56

Closed
muei opened this issue Jun 29, 2018 · 6 comments
Closed

The select component in popver will autoclose when selete item #56

muei opened this issue Jun 29, 2018 · 6 comments

Comments

@muei
Copy link

muei commented Jun 29, 2018

version: 0.6.1
This bottom is the small example,

<template lang="pug">
a-popover(
  placement="bottomRight"
  trigger="click"
  )
    div#content(slot="content")
      a-select()
        a-select-option() xxx
        ... 
</template>

When I click the select item, the popover will be colsed, but I only expect colsed when outside the content element.

@tangjinzhou
Copy link
Member

please update to 0.6.5 and use getPopupContainer like this:

<a-select slot="content" :getPopupContainer="triggerNode => triggerNode.parentNode">
     ...
</a-select>

@muei
Copy link
Author

muei commented Jul 2, 2018

In my case, the slot content is not on select, it's on the element content, so that I can diy more match my service, for example

<template lang="pug">
a-popover(
  placement="bottomRight"
  trigger="click"
  )
    a-form#content(slot="content" layout='inline')
      a-form-item
        a-select()
          a-select-option() xxx
          ... 
      a-button Click
</template>

The same problem has happened, in this scene, when I select the option, the form will close, this is not I expect, because I have a lot things go on to do before closing the form. Can you help me to resolve it, thanks!

@tangjinzhou
Copy link
Member

You can use the visible to control the Popover display state.
Or use getPopupContainer in the popup component like Select Menu and any more.
In addition, Why do you use such complex components in Popover?
You can replace Popover with Modal.

@tangjinzhou
Copy link
Member

tangjinzhou commented Jul 2, 2018

please update to 0.6.5 and use getPopupContainer like this:

<a-select :getPopupContainer="triggerNode => triggerNode.parentNode">
     ...
</a-select>

There is no relationship between slot and getPopupContainer.

@muei
Copy link
Author

muei commented Jul 2, 2018

First the Modal is not flexible to positioning, and I used the visible property with click-outside directive, it's works not well. I followed your suggesting, but happened again, I'm trying again, thanks

@muei muei closed this as completed Jul 2, 2018
@lock
Copy link

lock bot commented Jul 2, 2019

This thread has been automatically locked because it has not had recent activity. Please open a new issue for related bugs and link to relevant comments in this thread.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants