shipshapecode/shepherd

Shepherd.js generates invalid HTML buttons (missing "type" attribute)

Closed this issue · 9 comments

The buttons that are generated by shepherd.js are invalid because of this rule:
https://html-validate.org/rules/element-required-attributes.html

error: <button> is missing required "type" attribute (element-required-attributes)

The solution would be to add the type=button attribute when generating the buttons in shepherd.js.

Thank you! Will this be part of 12.0.2?

@Piedone yeah, that's the plan. Looking to improve the exports as part of that too.

Great, thanks!

@chuckcarpenter Hi! Is it possible that the exports have significantly changed since the release of 12.0.2? I upgraded Shepherd from 11.2.0 to ^12.0.2 and I can't make it export properly, shepherd is not attached to the global window. I included it as a module but no success.

@Psichorex yeah, I'd look at the latest version (v12.0.6) and the paths now are specifically for ESM or CJS. Could you try that and otherwise let me know exactly what's not working?

@Psichorex yeah, I'd look at the latest version (v12.0.6) and the paths now are specifically for ESM or CJS. Could you try that and otherwise let me know exactly what's not working?

@chuckcarpenter I tried both 12.0.6 and 12.0.2 both had shepherd.mjs currently I am on 12.0.6

Here you can see the script included in the footer as module:
image

Problem:
Our Tour script can't reference shepherd as it is undefined
image

node_modules folder have the 12.0.6 and all its dependencies.
I did not change anything else from 11.2.0 just the package.json to reference the new version.

Am I missing something or this should be working?

@Psichorex well, your src path is not correct (v12 is a major version and means breaking changes) as for ESM you'd want to use /dist/esm/shepherd.mjs

Aside from that, perhaps it's best to create a new issue if you're still having problems or come to the Discord to discuss? https://discord.gg/2XJeMMf3

@chuckcarpenter Joined the discord. Our path is different because we are using a service to copy assets in our projects wwwroot folder. So it is basically lifting the shepjerd.msj from dist/esm/shepherd.js to our wwwroot/shepherd.js/js/shepherd.mjs.
I can't tell at the moment if this issue is related to ASP.net environment or it roots from Shepherd. I joined the discord my name is the same.