sciter-sdk / go-sciter

Golang bindings of Sciter: the Embeddable HTML/CSS/script engine for modern UI development
https://sciter.com
2.57k stars 268 forks source link

Table hover bug #252

Closed ACLzz closed 3 years ago

ACLzz commented 3 years ago

Hello, I think I found a bug with table element. Code, description and example are here.

Tell me if I doing something wrong or how to hot fix it please.

Maybe I can do it with tis script, I'm not good in js and tis, maybe you can write me example how to load rows to table via tis?

ACLzz commented 3 years ago

Can you help me? I still didn't figure out what's wrong

pravic commented 3 years ago

cc @c-smile

c-smile commented 3 years ago

You have broken table structure here: https://github.com/ACLzz/sciter-table-bug/blob/main/templates/passwords.html

The table should look like:

<table #passes>
     <thead>
          <tr>
                    <th>Title</th>
                    <th>Login</th>
                    <th>Email</th>
                    <th>Password</th>
                </tr>
      </thead>
      <tbody>
                <tr>
                    <td>Title<div class="cell-hover" #cell-hover><input type="button" value="Show"><input type="button" value="Copy"></div></td>
                    <td>Login<div class="cell-hover" #cell-hover><input type="button" value="Show"><input type="button" value="Copy"></div></td>
                    <td>Email<div class="cell-hover" #cell-hover><input type="button" value="Show"><input type="button" value="Copy"></div></td>
                    <td>Password<div class="cell-hover" #cell-hover><input type="button" value="Show"><input type="button" value="Copy"></div></td>
                </tr>
            </tbody>
            </table>

and you should add rows to the tbody section. HTML5 spec. mandates tbody element insertion if it is not present. And so, without explicit tbody, you are adding rows in a wrong place.

ACLzz commented 3 years ago

Oh thanks, never heard about thead and tbody. It works now. I think I need to learn more about html5. Thank you again

pravic commented 3 years ago

Thanks, Andrew!