Trix: keyboard shortcut for bullets

Created on 6 Nov 2019  路  6Comments  路  Source: basecamp/trix

A keyboard shortcut for bullets would really make my life easier. I propose command + u (unordered list). Would this really be very hard to implement? People have been complaining about this for years, but it seems Basecamp doesn't have the will to make it happen. Is this something the maintainers are philosophically against? (Would it be as waste of my time to hire a dev to make a pull request?)

Most helpful comment

is there someway for me to self-host the Basecamp3 code so that I can compile a new version with a shortcut?

All 6 comments

+1

You can add or modify keyboard shortcuts for any of the toolbar buttons by setting their data-trix-key attribute. See https://github.com/basecamp/trix/issues/643#issuecomment-505028254.

is there someway for me to self-host the Basecamp3 code so that I can compile a new version with a shortcut?

The easiest way to add your own shortcut is with a snippet of JavaScript like:

addEventListener("trix-initialize", event => {
  const { toolbarElement } = event.target
  const bulletButton = toolbarElement.querySelector("[data-trix-attribute=bullet]")
  bulletButton.setAttribute("data-trix-key", "u")
})

THis needs to be in the app. I can't add the snippet when running basecamp on my iPad or using the Mac App. That woudl only run in a browser right?

Correct. I assumed you were using Trix in your own application, but now I see you're making a feature request for Basecamp. Noted!

In the future, you can direct Basecamp feature requests to https://basecamp.com/support

Was this page helpful?
0 / 5 - 0 ratings