1

I want to display a tooltip on an element, like:

  <div class="ui item"
         data:data-tooltip="Choose the adapter job"
         data:data-position="bottom right">
      <select id="jobConfigSelect"
              class="ui compact dropdown"
              onchange={_: Event =>
                changeSelectedJobConfig(jobConfigSelect.value))}>
        {Constants(jobConfigs.configs.values.map(selJobConfigOption).toSeq: _*)
        .map(_.bind)}
      </select>
    </div>

This gives this strange error: enter image description here

Without these 2 lines:

data:data-tooltip="Choose the adapter job"
data:data-position="bottom right"

the code runs perfectly.

pme
  • 14,156
  • 3
  • 52
  • 95

2 Answers2

1

After some 'trying' I found this solution:

You cannot have the data:data-tooltipattribute in the same method as you have a Constants construct. So you have to split them:

    ...
    <div class="ui item"
         data:data-tooltip="Choose the adapter job"
         data:data-position="bottom right">
      {selJobConfigSelect(jobConfigs).bind}
    </div>
  }

  @dom
  private def selJobConfigSelect(jobConfigs: JobConfigs) = {
    <select id="jobConfigSelect"
            class="ui compact dropdown"
            onchange={_: Event =>
              changeSelectedJobConfig(jobConfigs.fromIdent(s"${jobConfigSelect.value}"))}>
      {Constants(jobConfigs.configs.values.map(selJobConfigOption).toSeq: _*)
      .map(_.bind)}
    </select>
  }

What I haven't figured out is: Why this is?

pme
  • 14,156
  • 3
  • 52
  • 95
1

It looks like a Scala compiler bug that has been fixed in latest Scala 2.12.

It compiles in Scala 2.12, and causes error in Scala 2.11.

Yang Bo
  • 3,586
  • 3
  • 22
  • 35