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

[Bug] xhtml document rendering breaks functionality of calendar click handler. #550

Closed
adjenks opened this issue Nov 26, 2020 · 4 comments
Closed

Comments

@adjenks
Copy link

adjenks commented Nov 26, 2020

Vue2-datepicker version: 3.8.0
Vue version: 2.6.12
Browser: All

Steps to reproduce
Render page as an XHTML document by passing a "content-type" header with the value "application/xhtml+xml" from the server.

Expected behavior
Clicking on a date works

Actual behavior
Clicking on a date doesn't work.

in handleCellClick the function checks the tag name like so:

      if (target.tagName === 'DIV') {
        target = target.parentNode;
      }

The problem is that in an xhtml document tag names don't become capitalized on their object representation, they remain in whatever case they were written in, so for me tagName was "div" not "DIV". You can mitigate this by doing a simple .toUpperCase() or something like that.

@adjenks
Copy link
Author

adjenks commented Nov 26, 2020

I noticed there were several places in the code that check the "tagName", they should probably all be made compatible with xhtml document quirks.

@adjenks
Copy link
Author

adjenks commented Nov 26, 2020

See here for discussion about the issue: https://stackoverflow.com/questions/27223756/is-element-tagname-always-uppercase

@mengxiong10
Copy link
Owner

v3.8.1 fixed it.

@adjenks
Copy link
Author

adjenks commented Nov 26, 2020

Thank you. You should get a bitcoin wallet and put up a QR code for that too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants