Skip to content

feat(table): Support contextmenu event binding for table rows #2064

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

Merged
merged 1 commit into from
Oct 23, 2018

Conversation

peterjosling
Copy link
Contributor

Allows for right click as well as existing click + double click.

@peterjosling peterjosling changed the title Support contextmenu event binding for table rows feat(table): Support contextmenu event binding for table rows Oct 7, 2018
@codecov
Copy link

codecov bot commented Oct 7, 2018

Codecov Report

Merging #2064 into dev will decrease coverage by 3.46%.
The diff coverage is 75%.

Impacted file tree graph

@@            Coverage Diff             @@
##              dev    #2064      +/-   ##
==========================================
- Coverage   64.76%   61.29%   -3.47%     
==========================================
  Files         154      154              
  Lines        2903     2891      -12     
  Branches      799      797       -2     
==========================================
- Hits         1880     1772     -108     
- Misses        735      803      +68     
- Partials      288      316      +28
Impacted Files Coverage Δ
src/components/table/table.js 76.43% <75%> (+1.21%) ⬆️
src/utils/bv-event.class.js 0% <0%> (-72.73%) ⬇️
src/components/modal/modal.js 23.83% <0%> (-40.59%) ⬇️
src/directives/modal/modal.js 55.55% <0%> (-22.23%) ⬇️
src/utils/dom.js 50.57% <0%> (-6.9%) ⬇️
src/utils/object.js 46.66% <0%> (-3.34%) ⬇️
src/mixins/pagination.js 58.87% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b699e4b...d14e5ba. Read the comment docs.

peterjosling pushed a commit to peterjosling/apple-music-webplayer that referenced this pull request Oct 8, 2018
Easier to hit than a small click target on the right.

Ideally it would pop up at the click position, but I'm having trouble getting Bootstrap Vue to do what I want. This is an improvement for now.

Had to hack it a bit to store the ID of the song in the DOM, on each TD element. I've filed a pull request to add contextmenu event support to the table component natively (bootstrap-vue/bootstrap-vue#2064), but this is the only way I could think to do it for now.
zachomedia pushed a commit to zachomedia/apple-music-webplayer that referenced this pull request Oct 12, 2018
Easier to hit than a small click target on the right.

Ideally it would pop up at the click position, but I'm having trouble getting Bootstrap Vue to do what I want. This is an improvement for now.

Had to hack it a bit to store the ID of the song in the DOM, on each TD element. I've filed a pull request to add contextmenu event support to the table component natively (bootstrap-vue/bootstrap-vue#2064), but this is the only way I could think to do it for now.
@Joebayld
Copy link

Would love to see this get merged!

@tmorehouse
Copy link
Member

I think the event name should be row-contextclicked rather than row-rightclicked, as some left handed users have configured their computer to swap the mouse button positions (i.e. select on right, context on left), as well as some computers only have a single button (i.e. apple) and use a click sequence to indicate context.

Allows for right click as well as existing click + double click.
@peterjosling
Copy link
Contributor Author

Good thinking. I've renamed it to row-contextmenu instead of row-contextclicked, as that matches the native browser event.

TIL: the browser event is contextmenu instead of right click because it also fires for the context key.

@tmorehouse tmorehouse merged commit 1eced46 into bootstrap-vue:dev Oct 23, 2018
shinrox added a commit to shinrox/bootstrap-vue that referenced this pull request Oct 26, 2018
* dev: (31 commits)
  feat(card): support left and right image placement (bootstrap-vue#1981)
  fix(collapse/toggle): "collapsed" class cleared when component updated (bootstrap-vue#2102)
  fix(form-file): Add validation of single file (bootstrap-vue#2028)
  chore(docs): minor update to the b-form-input docs
  chore(docs): Minor update to b-form-input docs
  feat(table): Add row-unhovered event (bootstrap-vue#1874)
  feat(table): Support contextmenu event binding for table rows (bootstrap-vue#2064)
  docs(table): fix minor typo (bootstrap-vue#2093)
  feat(table): Support sorting on nested object properties (bootstrap-vue#1868)
  perf(modal): optimize model.resetScrollbar, resolves bootstrap-vue#1831  (bootstrap-vue#1837)
  docs: Update images reference section (bootstrap-vue#1999)
  fix(observe-dom): fix comment typo (bootstrap-vue#2084)
  chore(modal): trivial word fix in comment (bootstrap-vue#2089)
  (docs): Fix grammer in Intro readme (bootstrap-vue#2092)
  fix(modal): prevent scrolling on .modal-content focus, fixes bootstrap-vue#1748 (bootstrap-vue#2060)
  feat(pagination):  added slots for first, prev, next, last, and ellipsis. Fixes bootstrap-vue#1870. (bootstrap-vue#1980)
  Handle state change on validated fields. (bootstrap-vue#1984)
  fix(docs): input group prepend slot typo (bootstrap-vue#2059)
  fix(dependencies): replace opencollective with opencollective-postintall (bootstrap-vue#2067)
  fix(docs): change b-input-group attribute 'left' to 'prepend' (bootstrap-vue#2017)
  ...
@tmorehouse tmorehouse mentioned this pull request Nov 14, 2018
89 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants