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

Dropdown opening on contextmenu (right mouse button) click #7232

Closed
Tarlord opened this issue Aug 16, 2017 · 4 comments
Closed

Dropdown opening on contextmenu (right mouse button) click #7232

Tarlord opened this issue Aug 16, 2017 · 4 comments
Assignees

Comments

@Tarlord
Copy link

Tarlord commented Aug 16, 2017

What problem does this feature solve?

It would be very nice to have 3rd trigger value as 'context-menu' or 'contextMenu' for user to be able to open menu by right clicking on dropdown item. I had a request in my project and to solve it i was required to hardcode context menu click over dropdown and make all the hiding dropdown stuff on top of it(like when you click outside dropdown it was not triggered because i was manually setting up visible option). Thanks!
It's more like a feature not a bug :)

What does the proposed API look like?

ReactDOM.render(<div>
  <Dropdown overlay={menu} trigger={['contextMenu']}>
    <a className="ant-dropdown-link" href="#">
      Click me <Icon type="down" />
    </a>
  </Dropdown>
</div>, mountNode);
@benjycui
Copy link
Contributor

Try:

<Dropdown overlay={menu} visible={visible} onVisibleChange={this.handleVisibleChange}>
  <a className="ant-dropdown-link" href="#" onContextMenu={this.handleVisibleChange}>
    Click me <Icon type="down" />
  </a>
</Dropdown>

@benjycui
Copy link
Contributor

Right click is rarely used in web, it's not recommended to do so.

@afc163 afc163 reopened this Aug 18, 2017
@afc163
Copy link
Member

afc163 commented Aug 18, 2017

It could be useful for electron environment.

@MrPeak
Copy link
Contributor

MrPeak commented Sep 25, 2017

The dependency chain is as follows:

  • ant-design/dropdown
  • react-component/dropdown
  • react-component/trigger

These components above will all add this feature...

@yesmeck yesmeck removed the Invalid label Oct 26, 2017
afc163 added a commit that referenced this issue Nov 26, 2017
@afc163 afc163 closed this as completed Nov 26, 2017
yesmeck added a commit that referenced this issue Dec 1, 2017
* update @layout-body-background

* fix tag radius

* Add size="large" Tabs

* update card demo

* Fix upload loading

* bump

* Tweak card background

* rollback popconfirm padding

* Tweak progress dot step style

* Tweak popover arrow style

* update dark menu color

* update style

* update gray color

* bump

* Upgrade antd-tools

* fix tabs style

* bump

* Tweak style

* Oops.

* refactor: extract common locale logic (#7915)

* use @heading-color again

* Fix snapshot

* Fix autoprefix warning

* test: fix CI

* update card and tabs style

* bump

* fix snapshot

* Fix menu style

* Fix mini size pagination style

* deps: upgrade bisheng (#7985)

* fix: should not import moment while useless, close: #8013

* Fix upload style

* Fix menu active border

* bump

* Fix menu style

* bump

* Tweak list style

* Fix list border

* deps: upgrade deps

* Tweak select arrow style

* bump

* update demo

* Add Divider[dashed] prop

* tweak Card style

* update list grid padding bottom

* bump

* try to fix ci

* Upgrade rc-time-picker to 3.0.0

Add `hourStep` `minuteStep` `secondStep`

* update TimePicker demo snapshot

* Fix input shadow in iOS safari, ref #7974

* Fix snapshot

* update iconfont zip url

* update select group title style

* Fix api order

* chore: update size props order, ref: d12f247

* Add china mirror link in footer

* Remove modao

* 2.13.8 change log review (#8041)

bump 2.13.8

* add the 'selectable' attribute (#8048)

* Fix input checkbox or radio disappeared, ref #7974

* Fix progress dot step style

* fix: upgrade rc-form and refactor to be compatible with react@16

* Add form wrappedComponentRef test

* test: simplify snapshots for LocaleProvider

* bump beta

* vertical progressDot Steps style

* bump

* Fix Alert backgroun and border color

* bump

* deps: upgrade TypeScript to 2.6, close #8018

* update code style

* Support responsively grid gutter

* bump

* Fix test case

* Fix enquire in server render

* Fix responsive grid gutter

* bump

* Fix gutter PropTypes

* avoid triggering unmatch when unregister

* Add Badge[offset]

* Feature antd 3.0/spinning indicator (#7977)

* Added indicator props to Spin component

* Added indicator props to Spin component

* update snapshots

* fix defautl props

* revert some snapshot files

* Update snapshot

* Review fix (#8125)

* Fix style

* Fix style

* fix lint

* Fix more styles

* Fix more styles

* update snap

* bump new beta

* Fix ts compile error

* use development react in dev

* Fix key warning

* Run test against multiple react versions

* Fix test_node

* Fix snapshot

* Add support for column defaultSortOrder (#6449) (#8111)

Fixes #6449

* Fix snapshot

* Fix super argument

* Fix snapshot

* Fix Rate style under form item

* Tweak cascader arrow style

* update form demo

* site: clean cached before start, close: benjycui/bisheng#113

* Update dependendies (#8150)

* deps: upgrade rc-menu, and close: #2837

* test: update snapshots

* Update rc-calendar

* Update rc-cascader

* Update rc-dialog

* Update dropdown

* Update [email protected]

* Update rc-slider

* Update rc-time-picker

* Update rc-tooltip

* Update rc-tree-select

* Mock rc-trigger and Portal

* Fix animation warning when inlineCollapsed changes

* fix: should use SubMenu[popupClassName]

* Fix typescript error

* Fix lint

* fix: style for menu

* Mock rc-trigger for React 15

* Remvoe allow_failures

* Add a variable to control processing colors (#8166)

* Allow Badge[status] usage with Badge[children], close #8164

* Fix badge style

* bump

* Add table filter test

* Feature: uk_UA locale (#8169)

* Add uk-UA localization

Ukrainian localization for the following components:

- locale-provider
- DatePicker
- TimePicker
- Calendar

* Add uk_UA locale to test suite

* Add uk_UA locale to tests snapshot

Tests on CI are failing because there are no snapshot for uk_UA locale.
Generate a snapshot with `npm test -u` command and add it to the test
suite.

* fix: should not throw error when keydown in menu, close: #8089 (#8211)

* List empty style (#8190)

* Fixed List snapshots

* Remove allowSyntheticDefaultImports (#8218)

* 3.0.0-beta.8

* Add source-map

* Fix footer nav

* Update rc-table (#8187)

* Update rc-table

* Add table drag sorting demo

* update menu responsive, ref #4682 (#8226)

* update menu responsive, ref #4682

* update popover menu style

* deps: upgrade form to 2.0.0 (#8207)

* Fix table row selected className

Close #8074 #8075

* Rename TableRow to BodyRow

* export BodyRowClass

* Fix message cannot hide bug, close #8201

* Fix MenuItem margin

* bump beta

* Allow fix table selection column (#8195)

* Focus && blur support (#8204)

* Add test for select

* Add focus() and blur() for AutoComplete

* Add focus() and blur() to Cascader

* Add focus test for input

* Add focus() and blur() for Checkbox

* Add focus() and blur() for Radio

* Add focus() and blur() for Switch

* Add blur() for TimePicker

* Add focus() and blur() to TreeSelect

* Update rc-input-number

* Update rc-rate

* Update rc-select

* Update rc-scroll-admin

* Update rc-scroll-anim

* Oops.

* Remove [email protected] and react@15 from peerDependencies

* Update snapshot

* Update rc-time-picker

* Add use in TypeScript instruction (#8230)

* Bump 3.0.0-rc.1

* feat: upgrade rc-menu (#8235)

* Fix menu active style

close ant-design/ant-design-pro#222

* Fix submenu width, close #8236

* Fix submenu z-index

* site: fix demo, close: #8227

* Improve upload type definition.

* Improve upload type definition

* style: Use single quote

* Imporve tree and tree-select type definitions

* Improve Transfer type definitions.

* Improve Tooltip type definitions

* Improve TimePicker type definitions

* Fix implicit any error for Tabs.

* fix: submenu should work fine in dropdown, close: #8248

* fix mobile menu (#8252)

* Fix implicit any error for Table

* Fix implicit any for Select Slider Spin Switch

* Fix implicit any for Radio

* Fix implicit any error for Pagination PopConfirm Popover Progress

* Fix implicit any error for Notification

* Fix ssr site build, ref #8249

* Add bisheng build in travis test

* fix lint

* Fix implicit any error for Modal and Message

* Fix implicit any error for Modal and Menu

* fix register of undefined, #8249

* Fix home page style

* Fix implicit any error for List

* Fix implicit any error for Layout

* Fix implicit any error for Mention

* Fix implicit any error for LocalProvider

* Fix implicit any error for Input

* Fix implicit any error for Grid

* Fix implicit any error for Form

* Fix implicit any error for Divider

* Fix implicit any error for DatePicker

* Fix implicit any error for Checkbox

* Fix implicit any error for Cascader

* Fix implicit any error for Carousel

* Fix implicit any error for Calendar

* Fix implicit any error for Card

* Fix implicit any error for Breadcrumb

* Fix implicit any error for Badge

* Fix implicit any error for AutoComplete

* Fix implicit any error for Anchor

* Fix implicit any error for Affix

* Fix implicit any error for _util

* Fix code style

* Enable noImplicitAny

Close #5627

* docs: No require skipLibCheck

* Fix message destroy problem, close #8201

* upgrade rc-form

* 3.0.0-rc.2

* Fix table row create on every render.

Fix #8283

* Fix dark menu popup animation

* bump rc

* add 3 icons

* Fix enquire.js dep

close ant-design/ant-design-pro#280

* make children prop of RadioGroupProps optional (#8307)

* contextMenu Dropdown, close #7232

* change children prop of TableProps to React.ReactNode (#8317)

* make children prop of RadioGroupProps optional

* change children prop of TableProps to React.ReactNode

* Tweak components style detail

* Upgrade antd 3.0 site style (#8324)

* 3.0 site update

* update footer

* improve

* site: fix menu z-index

* tweak style

* site: Add replaceLib plugin to babel

* Upgrade rc-select

* Fix less path warning, close #8388

* Upgrade rc-rate

* Update snapshot

* update logo

* Better responsive style of Table

* reset text-color and etc.

* change lang-button pos & improve footer responsive

* fix menu text color

* improve footer style

* Link button (#8343)

* support link button

* Fix type

* upgrade rc-calendar dependency to 9.3.0 (#8353)

* fix menu style

* fix page jumper style

* Revise docs (#8368)

* Upgrade dev deps and fix lints (#8358)

* upgrade devDeps and fix lint

* Fix stylelint problems

* improve form demo

* seperate dark style of menu

* update introduce text

* bump 3.0.0-rc.4

* Remove deprecations (#8351)

* Add focus() blur() and autoFocus to DatePicker (#8345)

* update home page style, close #8238

* Fix npm run site

* feature:add onCalendarChange for RangePicker (#8355)

* feature:add onCalendarChange for RangePicker

The event trigger when start time or end time is changing, which is useful for districting range user can select.

* Update index.zh-CN.md

update doc

* Update index.zh-CN.md

* Update index.zh-CN.md

* fix style and favicon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants