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

Feature labels disappear sometimes in Firefox #7132

Closed
quincylvania opened this issue Dec 17, 2019 · 3 comments
Closed

Feature labels disappear sometimes in Firefox #7132

quincylvania opened this issue Dec 17, 2019 · 3 comments
Labels
bug-browser-specific A bug that only appears in certain browsers help wanted For intermediate contributors, requires investigation or knowledge of iD code

Comments

@quincylvania
Copy link
Collaborator

I've noticed labels behave strangely in iD 2.16.0 on Firefox 70. One consistent bug is that all feature labels disappear upon selecting a feature and only reappear upon a redraw, triggered for example by panning the map or resizing the window. Could not reproduce this in Safari.

firefox label bug

@quincylvania quincylvania added the bug-browser-specific A bug that only appears in certain browsers label Dec 17, 2019
@quincylvania quincylvania changed the title Feature labels disappear when selecting something in Firefox Feature labels disappear sometimes in Firefox Mar 9, 2020
@quincylvania quincylvania added the help wanted For intermediate contributors, requires investigation or knowledge of iD code label Jun 1, 2020
@karlcow
Copy link

karlcow commented Sep 8, 2020

This can be reproduced in Firefox Nightly 82

@karlcow
Copy link

karlcow commented Sep 8, 2020

This is happening before the click, because when setting a breakpoint on the click, all labels have already disappeared. Once the selection is made a zoom in/zoom out or moving the map makes the label reappears while keeping the item selected. Also without clicking a hover a specific label makes it disappear.

the pointer not on top of the label.

<text class="pointlabel-halo point tag-tourism n6630299764" x="705.0164586752653" y="619.2783916816115" style="text-anchor: start;">The Quaker</text>

The pointer on top of the label

<text class="pointlabel-halo point tag-tourism n6630299764 nolabel" x="705.0164586752653" y="619.2783916816115" style="text-anchor: start;">The Quaker</text>

but when selecting a specific item it doesn't add nolabel to all items in the map. So that looks like more a painting issue with SVG?
When selecting it seems to reassign all the labels by rewriting them in the DOM.

This is calling

  function textFunction(t) {
    return function () {
      var e = t.apply(this, arguments);
      this.textContent = null == e ? '' : e
    }
  }

and it is going through each of them… and remove them

  function selection_each(e) {
    for (var t = this._groups, n = 0, r = t.length; n < r; ++n) for (var i, o = t[n], a = 0, s = o.length; a < s; ++a) (i = o[a]) && e.call(i, i.__data__, a, o);
    return this
  }

which is strange because the value is really the text for example e == The Quaker

Capture d’écran 2020-09-08 à 09 47 17

ah I wonder if it's related to https://bugzilla.mozilla.org/show_bug.cgi?id=725221

@quincylvania maybe just checking if textContent already exists with the same content, and if it does do not overwrite. Maybe that would work.

@tyrasd
Copy link
Member

tyrasd commented Feb 1, 2022

I can't reproduce this issue using Firefox version 96. Seems like it was either fixed in Firefox or by some other change in iD.

@tyrasd tyrasd closed this as completed Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug-browser-specific A bug that only appears in certain browsers help wanted For intermediate contributors, requires investigation or knowledge of iD code
Projects
None yet
Development

No branches or pull requests

3 participants