Skip to content

Commit 496ccc7

Browse files
committed
fix placeholder positioning bug
1 parent 8210b58 commit 496ccc7

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/components/titles/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@ var numStripRE = / [XY][0-9]* /;
4848
* @return {selection} d3 selection of title container group
4949
*/
5050
function draw(gd, titleClass, options) {
51-
5251
var fullLayout = gd._fullLayout;
5352

5453
var cont = options.propContainer;
@@ -365,8 +364,8 @@ function draw(gd, titleClass, options) {
365364

366365
if(subtitleEnabled) {
367366
// Adjust subtitle position now that title placeholder has been added
368-
// Only adjust if subtitle is enabled and title has a placeholder
369-
if(subtitleEnabled && el.classed('js-placeholder')) {
367+
// Only adjust if subtitle is enabled and title text was originally empty
368+
if(subtitleEnabled && !txt) {
370369
var ht = Drawing.bBox(el.node()).height;
371370
var newSubtitleY = Number(subtitleEl.attr('y')) + ht;
372371
subtitleEl.attr('y', newSubtitleY);

0 commit comments

Comments
 (0)