geoffthibeau / simple-drag-drop-text

simple-drag-drop-text for Atom editor. Drag and drop text using the mouse.
https://atom.io/packages/simple-drag-drop-text
MIT License
21 stars 3 forks source link

Uncaught TypeError: Cannot read property 'querySelector' of null #13

Closed leeyisoft closed 7 years ago

leeyisoft commented 8 years ago

[Enter steps to reproduce below:]

  1. ...
  2. ...

Atom Version: 1.5.4 System: Mac OS X 10.11.3 Thrown From: simple-drag-drop-text package, v0.3.0

Stack Trace

Uncaught TypeError: Cannot read property 'querySelector' of null

At /Users/leeyi/.atom/packages/simple-drag-drop-text/lib/simple-drag-drop-text.coffee:31

TypeError: Cannot read property 'querySelector' of null
    at /Users/leeyi/.atom/packages/simple-drag-drop-text/lib/simple-drag-drop-text.coffee:31:54
    at doNTCallback0 (node.js:419:9)
    at process._tickCallback (node.js:348:13)

Commands

     -3:59.2.0 core:copy (atom-notification.fatal.icon.icon-bug.native-key-bindings.has-detail.has-close.has-stack)
     -3:10.7.0 core:confirm (input.hidden-input)

Config

{
  "core": {
    "disabledPackages": [
      "language-java",
      "language-hyperlink",
      "language-ruby",
      "language-ruby-on-rails",
      "language-toml",
      "language-csharp",
      "wrap-guide",
      "language-clojure",
      "language-coffee-script",
      "language-gfm",
      "keybinding-resolver",
      "language-go",
      "language-objective-c",
      "language-perl",
      "java-generator"
    ],
    "followSymlinks": true,
    "packagesWithKeymapsDisabled": [
      "atom-alignment"
    ],
    "themes": [
      "atom-light-ui",
      "eiffel-syntax"
    ]
  },
  "simple-drag-drop-text": {
    "copyKey": "ctrl"
  }
}

Installed Packages

# User
atom-alignment, v0.12.1
copy-path, v0.4.0
css-snippets, v0.9.0
editorconfig, v1.2.4
eiffel-syntax, v0.4.0
highlight-selected, v0.11.2
language-erlang, v3.0.0
language-swift, v0.4.0
linter, v1.11.3
linter-erlc, v0.3.0
simple-drag-drop-text, v0.3.0
vim-mode, v0.64.0

# Dev
No dev packages
suns-echoes commented 8 years ago

I have found out that this error happens when you have disabled shadow root in your settings.

Just edit "lib/simple-drag-drop-text.coffee" file this way:

find: @lines = atom.views.getView(@editor).shadowRoot.querySelector
replace: @lines = atom.views.getView(@editor).querySelector

For me this solves the problem :)

mark-hahn commented 8 years ago

Can you put that in as a PR?

On Fri, Apr 22, 2016 at 3:13 PM, cmosespl notifications@github.com wrote:

I have found out that this error happens when you have disabled shadow root in your settings.

Just edit "lib/simple-drag-drop-text.coffee" file this way:

find: @lines https://github.com/lines = atom.views.getView(@editor).shadowRoot.querySelector replace: @lines https://github.com/lines = atom.views.getView(@editor).querySelector

For me this solves the problem :)

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/mark-hahn/simple-drag-drop-text/issues/13#issuecomment-213606783

suns-echoes commented 8 years ago

Done.

update to code:

      @lines = atom.views.getView(@editor)
      if @lines.shadowRoot
        @lines = @lines.shadowRoot.querySelector '.lines'
      else
        @lines = @lines.querySelector '.lines'
mark-hahn commented 8 years ago

Did you follow the github docs? You need to fork, pull, modify, push, and then request the PR.

On Sat, Apr 23, 2016 at 12:00 AM, cmosespl notifications@github.com wrote:

When I try to do pull request is gives me access denied...

— You are receiving this because you commented. Reply to this email directly or view it on GitHub https://github.com/mark-hahn/simple-drag-drop-text/issues/13#issuecomment-213677568

ADTC commented 8 years ago

@cmosespl Check out https://guides.github.com/activities/contributing-to-open-source/#contributing Let's make it a PR :)

geoffthibeau commented 7 years ago

I believe this issue was resolved and returned shortly in #23.