Skip to content

fix edit colorbarTitleText #7487

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

Merged
merged 2 commits into from
Jul 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions draftlogs/7487_fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix edit colorbar title [7487](https://github.com/plotly/plotly.js/pull/7487)
4 changes: 2 additions & 2 deletions src/components/titles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var SUBTITLE_PADDING_EM = 1.6;
* @param {DOM element} gd - the graphDiv
* @param {string} titleClass - the css class of this title
* @param {object} options - how and what to draw
* propContainer - the layout object containing the `title` attribute that
* propContainer - the layout object containing the `title` attribute that
* applies to this title
* propName - the full name of the title property (for Plotly.relayout)
* [traceIndex] - include only if this property applies to one trace
Expand Down Expand Up @@ -102,7 +102,7 @@ function draw(gd, titleClass, options) {
var editAttr;
if(prop === 'title.text') editAttr = 'titleText';
else if(prop.indexOf('axis') !== -1) editAttr = 'axisTitleText';
else if(prop.indexOf('colorbar' !== -1)) editAttr = 'colorbarTitleText';
else if(prop.indexOf('colorbar') !== -1) editAttr = 'colorbarTitleText';
Copy link
Contributor Author

@archmoj archmoj Jul 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not able to replicate a bug as a result of this typo.
The typo was present since 2017 from b4e26ae.

The last condition would translate to

else if(prop.indexOf(true)) editAttr = 'colorbarTitleText';

Which is obliviously not what we wanted.

var editable = gd._context.edits[editAttr];

function matchesPlaceholder(text, placeholder) {
Expand Down