Skip to content

Commit 6599d8b

Browse files
authored
Map azure - it should be possible to pass a markup to a tooltip (T1277923) (DevExpress#29036)
1 parent 1a534d3 commit 6599d8b

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

packages/devextreme/js/__internal/ui/map/m_provider.dynamic.azure.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ const AzureProvider = DynamicProvider.inherit({
330330

331331
options = this._parseTooltipOptions(options);
332332

333-
const $content = $('<div>').text(options.text).addClass(MAP_MARKER_TOOLTIP_CLASS);
333+
const $content = $('<div>').html(options.text).addClass(MAP_MARKER_TOOLTIP_CLASS);
334334
const popup = new atlas.Popup({
335335
content: $content[0],
336336
position: location,

packages/devextreme/testing/tests/DevExpress.ui.widgets/mapParts/azureTests.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,24 @@ QUnit.module('Markers', moduleConfig, () => {
567567
});
568568
});
569569

570+
QUnit.test('It should be possible to pass a markup to marker tooltip.text option', function(assert) {
571+
const done = assert.async();
572+
const marker = { location: [10, 20], tooltip: { text: '<b>Austin</b>, Texas' } };
573+
$('#map').dxMap({
574+
provider: 'azure',
575+
markers: [marker],
576+
onReady: () => {
577+
const $popupContent = $(atlas.popupOptions.content);
578+
const $b = $popupContent.find('b');
579+
580+
assert.strictEqual($b.length, 1, '<b> element is passed to Popup');
581+
assert.strictEqual($b.text(), 'Austin', 'text is correct');
582+
583+
done();
584+
}
585+
});
586+
});
587+
570588
[false, true].forEach((isShown) => {
571589
QUnit.test(`Click on marker should ${isShown ? 'hide' : 'show'} Popup if tooltip.isShown=${isShown}`, function(assert) {
572590
const done = assert.async();

0 commit comments

Comments
 (0)