SSShooter / SSShooter/mind-elixir-core

Editable should prevent edit but not selection

Open
#215 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
3.2k
Forks
415
PR merge metrics
No merged PRs in 30d

Description

From mouse.ts,

mind.map.addEventListener('click', e => {
   // if (dragMoveHelper.afterMoving) return
   // e.preventDefault() // can cause <a /> tags don't work
   const target = e.target as any
   if (target.tagName === 'ME-EPD') {
     mind.expandNode((target as Expander).previousSibling)
   } else if (!mind.editable) {
     return
   } else if (isTopic(target)) {
     mind.selectNode(target as Topic, false, e)
   } ...
   
   
    mind.map.addEventListener('dblclick', e => {
   e.preventDefault()
   if (!mind.editable) return
   const target = e.target as HTMLElement
   if (isTopic(target)) {
     mind.beginEdit(target as Topic)
   }
 })

Preventing dblclick makes sense but preventing selection itself does not make sense I think. I have a teacher, student use case where students can't edit a node but should be able to select the node and use focus. I currently cannot do this because setting editable = false is making the mindmap readonly with no interactions. Focus or select or unselect are all passive operations and shouldn't be considered for mind.editable

Does anyone have a suggestion on how I can get selection to work without allowing dblclick?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in mouse.ts by reading the click and dblclick handlers and how mind.editable gates their behavior. Verify that a non-editable mind map still allows selecting, focusing, and unselecting nodes while double-click editing remains disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.