Skip to content
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

Request: add placeholder argument #47

Closed
VMJim opened this issue Nov 28, 2016 · 3 comments
Closed

Request: add placeholder argument #47

VMJim opened this issue Nov 28, 2016 · 3 comments

Comments

@VMJim
Copy link

VMJim commented Nov 28, 2016

A nice feature would be a placeholder argument just like textInput(placeholder = "type some code here", ...).

Give it a thought :)

Jim

@vnijs
Copy link
Collaborator

vnijs commented Apr 2, 2018

This SO answer suggests it is possible. Happy to look at a PR

@vnijs
Copy link
Collaborator

vnijs commented Jun 27, 2019

@VMJim I added an option to specify a placeholder when the shinyAce editor is empty based on this SO answer: https://stackoverflow.com/a/26700324/1974918

You can test it out by running the code below and clicking on the "Clear text" button or by simply removing the text in the editor manually.

install.packages("devtools")
devtools::install_github("trestletech/shinyAce")
shiny::runApp(system.file("examples/01-basic", package="shinyAce"))

This seems to work nicely in several themes BUT not all of them. In, for example, "tomorrow" the placeholder text is not visible, even though it is shown in the page source. Any suggestions for a fix are very welcome!

The relevant JS code is linked below.

https://github.com/trestletech/shinyAce/blob/master/inst/www/shinyAce.js#L257-L277
cc @saurfang @detule @GregorDeCillia

@vnijs
Copy link
Collaborator

vnijs commented Jul 1, 2019

Placeholder now works as expected for all themes when the shinyAce editor is empty based on this SO answer: https://stackoverflow.com/a/26700324/1974918

You can test it out by running the code below and clicking on the "Clear text" button or by simply removing the text in the editor manually.

Unless any new issues pop up I plan to push this release to CRAN towards the end of this week.

install.packages("devtools")
devtools::install_github("trestletech/shinyAce")
shiny::runApp(system.file("examples/01-basic", package="shinyAce"))

@vnijs vnijs closed this as completed Jul 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants