BorisMoore / jquery-tmpl

The original official jQuery Templates plugin. This project was maintained by the jQuery team as an official jQuery plugin. It is no longer in active development, and has been superseded by JsRender.
3.23k stars 1.01k forks source link

View is meshed up when using direction (ltr) #82

Closed pascalsaul closed 13 years ago

pascalsaul commented 13 years ago

Hello,

I have a list and the direction is set to LTR.

<!DOCTYPE html>
<html>
<head>
    <title>Bug direction LTR</title>
    <script src="http://code.jquery.com/jquery-latest.min.js"></script>
    <script src="http://ajax.microsoft.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script>
</head>
<body>
<ul id="rtl" style="direction: ltr;"></ul>
<ul id="ltr" style="direction: rtl;"></ul>
<script id="listTemplate" type="text/x-jquery-tmpl">
        <li>[${Id}]&nbsp;<a href="javascript:void(alert(${Id}));">${Name}</a>&nbsp;[${Id}]</li>
</script>
<script>
    var data = [
        { Id: "1", Name: "Item #1"},
        { Id: "2", Name: "Item #2"},
        { Id: "3", Name: "Item #3"}
    ];
$("#listTemplate").tmpl(data).appendTo($("#rtl").empty());
$("#listTemplate").tmpl(data).appendTo($("#ltr").empty());
</script>
</body>
</html>

All the browsers are showing it like: [Item #1 [0 [0]

If I remove the direction everything is fine...

What's going on?

pascalsaul commented 13 years ago

It's not a bug but has to do with: http://www.w3schools.com/TAGS/tag_bdo.asp

Never heard of it before...

Issue can be closed :)