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

Allow to disable DatePicker (etc.) after creation #13256

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

mattpap
Copy link
Contributor

@mattpap mattpap commented Jul 14, 2023

fixes #13255

@codecov
Copy link

codecov bot commented Jul 14, 2023

Codecov Report

Merging #13256 (f83af3f) into branch-3.3 (6bd0c04) will not change coverage.
The diff coverage is n/a.

@@             Coverage Diff             @@
##           branch-3.3   #13256   +/-   ##
===========================================
  Coverage       92.44%   92.44%           
===========================================
  Files             315      315           
  Lines           20107    20107           
===========================================
  Hits            18587    18587           
  Misses           1520     1520           

@mosc9575
Copy link
Contributor

mosc9575 commented Jul 14, 2023

Hi,

it looks like the changes have no visual effect but the state changes.

visual effect log
disable grafik

I was running the example below

from bokeh.io import show, output_notebook
from bokeh.layouts import column
from bokeh.models import Button, DatePicker, TextInput, CustomJS
output_notebook()

date = DatePicker(title="DatePicker", value="2019-09-20")
text = TextInput(title="TextInput", value="2019-09-20")

# Bokeh button which disables the picker from python
button = Button(label="enable/disable")
button.js_on_event(
    "button_click",
    CustomJS(
        args=dict(date=date),
        code="""
        console.log(date.disabled);
        date.disabled = !date.disabled;
        """
    )
)
button.js_on_event(
    "button_click",
    CustomJS(args=dict(text=text), code="""text.disabled = !text.disabled;""")
)
show(column(date, text, button))

@mattpap
Copy link
Contributor Author

mattpap commented Jul 14, 2023

Works for me:

Screencast_00000.mp4

Let's make sure the JS resources are up-to-date, because this looks like a caching issue.

@mosc9575
Copy link
Contributor

I have to apologize. Still can't reporduce the correct version on my maching but I added a log message and can't see the it.

@mattpap mattpap force-pushed the mattpap/13255_disable_date_picker branch from 2450ab6 to f83af3f Compare July 18, 2023 10:34
@mattpap
Copy link
Contributor Author

mattpap commented Jul 18, 2023

(...) Still can't reporduce the correct version on my maching but I added a log message and can't see the it.

Do you have "Disable cache" in devtools enabled? E.g.:

image

If so, then it's probably resources' resolution that's the problem. This may be known knowledge, but I will reiterate just in case. To make sure you use the most recently compiled resources, I strongly recommend running bokeh scripts with BOKEH_DEV=true BOKEH_RESOURCES=server-dev (which in bokeh 3.3 hopefully will be the default and thus reduced to just BOKEH_DEV=true) and then have BOKEH_DEV=true bokeh static running in a separate process/terminal.

@mosc9575
Copy link
Contributor

@mattpap Thanks for your help. Now I get the expected result.

@mattpap mattpap merged commit 0b30ef5 into branch-3.3 Jul 18, 2023
27 checks passed
@mattpap mattpap deleted the mattpap/13255_disable_date_picker branch July 18, 2023 12:39
@mattpap mattpap mentioned this pull request Jul 18, 2023
14 tasks
@mattpap mattpap modified the milestones: 3.3, 3.2.1 Jul 19, 2023
mattpap added a commit that referenced this pull request Jul 20, 2023
* Improve performance of WebGL line glyph (#13236)

* Improve performance of webgl line glyph

* Update baseline images

* Update ruff repo links (#13242)

* Fix `PropertyValueColumnData._stream()` to handle `rollover=0` (#13239)

* Fix `PropertyValueColumnData._stream()` to handle `rollover=0`

* Check 'event.data' in the unit tests

* Improve docs example in first_steps_8.rst (#13161)

* Improve docs example in first_steps_8.rst

* Update figure in docs example first_steps_8.rst

* Resolve issues with high DPI GridPlot exports (#13253)

* Allow to disable DatePicker (etc.) after creation (#13256)

* Use ../core/kinds instead of core/kinds in imports (#13254)

* Don't paint undisplayed plots (#13250)

* Update theme.py (#13270)

* Fixed Broken Link (#13266)

* Fixed Broken Link

* Update docs/bokeh/source/docs/first_steps/first_steps_9.rst

Co-authored-by: Bryan Van de Ven <bryan@bokeh.org>

---------

Co-authored-by: Bryan Van de Ven <bryan@bokeh.org>

* fix unterminated string literals in example code [skip ci] (#13274)

* Fix Legend's grid layout for uneven number of items (#13263)

* 13272 update legend docs (#13273)

* update docs for two dimensional legends

* Apply suggestions from code review

* Implement cloneable interface in ndarrays (#13232)

* Update docs/bokeh/switcher.json

* Added release notes

---------

Co-authored-by: Ian Thomas <ianthomas23@gmail.com>
Co-authored-by: Xiaoyang Liu <siujoeng.lau@gmail.com>
Co-authored-by: Christoph Deil <Deil.Christoph@gmail.com>
Co-authored-by: Moritz Schreiber <68053396+mosc9575@users.noreply.github.com>
Co-authored-by: Rajat Shenoi <rajatshenoi@outlook.com>
Co-authored-by: Bryan Van de Ven <bryan@bokeh.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Enabling/Disabled DatePickers does not work
3 participants