{"action":"created","issue":{"url":"https://api.github.com/repos/trestletech/shinyAce/issues/49","repository_url":"https://api.github.com/repos/trestletech/shinyAce","labels_url":"https://api.github.com/repos/trestletech/shinyAce/issues/49/labels{/name}","comments_url":"https://api.github.com/repos/trestletech/shinyAce/issues/49/comments","events_url":"https://api.github.com/repos/trestletech/shinyAce/issues/49/events","html_url":"https://github.com/trestletech/shinyAce/issues/49","id":265672235,"number":49,"title":"aceAutocomplete not working when invoked within module","user":{"login":"GregorDeCillia","id":9311130,"avatar_url":"https://avatars2.githubusercontent.com/u/9311130?v=4","gravatar_id":"","url":"https://api.github.com/users/GregorDeCillia","html_url":"https://github.com/GregorDeCillia","followers_url":"https://api.github.com/users/GregorDeCillia/followers","following_url":"https://api.github.com/users/GregorDeCillia/following{/other_user}","gists_url":"https://api.github.com/users/GregorDeCillia/gists{/gist_id}","starred_url":"https://api.github.com/users/GregorDeCillia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GregorDeCillia/subscriptions","organizations_url":"https://api.github.com/users/GregorDeCillia/orgs","repos_url":"https://api.github.com/users/GregorDeCillia/repos","events_url":"https://api.github.com/users/GregorDeCillia/events{/privacy}","received_events_url":"https://api.github.com/users/GregorDeCillia/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-10-16T07:34:16Z","updated_at":"2018-04-07T21:37:31Z","closed_at":"2018-04-07T21:37:31Z","author_association":"CONTRIBUTOR","body":"I read about [some previous](https://github.com/trestletech/shinyAce/issues/34) bug with shiny modules and I am afraid I found another one. When I call `aceAutocomplete` within a shiny module, autoComplete does not get enabled. Interestingly enough, everything works if I call `aceAutocomplete ` in the global server - even if the targeted input id is part of a module. Here is a minimal example. \r\n\r\n```\r\nEditor <- function(input, output, session){\r\n  ns = session$ns\r\n  shinyAce::aceAutocomplete(ns(\"editor\"))\r\n  shinyAce::aceAutocomplete(\"editor\")\r\n}\r\n\r\nEditorUI <- function(id){\r\n  ns = NS(id)\r\n  shinyAce::aceEditor(\r\n    ns(\"editor\"),\r\n    \"default\",\r\n    autoComplete = \"live\"\r\n  )\r\n}\r\n\r\nmy_id = \"editor_id\"\r\n#my_id = NULL\r\n\r\nshinyApp(\r\n  EditorUI(my_id),\r\n  function(input, output, session){\r\n    callModule(Editor, my_id)\r\n    #shinyAce::aceAutocomplete(NS(my_id, \"editor\"))\r\n  }\r\n)\r\n```\r\n\r\nIf either of the commented lines get removed, autocomplete is working properly. In the first case, the module basically writes its outputs in the main `session` since `NS(NULL)` is the identity function. In the second case, `aceAutocomplete` gets invoked with the same id but a different session argument.\r\n\r\nI found that passing session to the module as a parameter fixes the problem, but I really don't like this approach, since my modules are nested.\r\n\r\n```\r\ndomain <- session\r\ncallModule(Editor, my_id, domain)  # use domain in aceAutocomplete \r\n```"},"comment":{"url":"https://api.github.com/repos/trestletech/shinyAce/issues/comments/379501003","html_url":"https://github.com/trestletech/shinyAce/issues/49#issuecomment-379501003","issue_url":"https://api.github.com/repos/trestletech/shinyAce/issues/49","id":379501003,"user":{"login":"vnijs","id":2998956,"avatar_url":"https://avatars2.githubusercontent.com/u/2998956?v=4","gravatar_id":"","url":"https://api.github.com/users/vnijs","html_url":"https://github.com/vnijs","followers_url":"https://api.github.com/users/vnijs/followers","following_url":"https://api.github.com/users/vnijs/following{/other_user}","gists_url":"https://api.github.com/users/vnijs/gists{/gist_id}","starred_url":"https://api.github.com/users/vnijs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vnijs/subscriptions","organizations_url":"https://api.github.com/users/vnijs/orgs","repos_url":"https://api.github.com/users/vnijs/repos","events_url":"https://api.github.com/users/vnijs/events{/privacy}","received_events_url":"https://api.github.com/users/vnijs/received_events","type":"User","site_admin":false},"created_at":"2018-04-07T21:37:31Z","updated_at":"2018-04-07T21:37:31Z","author_association":"COLLABORATOR","body":"Thanks @GregorDeCillia. Closing issue "}}
{"actor":{"display_login":"vnijs"}}