Fix design bug (#2475)

This commit is contained in:
Isiah Meadows 2019-07-16 07:16:25 -04:00 committed by GitHub
parent 6e57a0691c
commit c2f269c3b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 25 additions and 25 deletions

View file

@ -191,14 +191,14 @@ module.exports = function($window, mountRedraw) {
assign(attrs, vnode.attrs)
// The first two are internal, but the rest are magic attributes
// that need censored to not screw up rendering.
attrs.component = attrs.options = attrs.key = attrs.oninit =
attrs.selector = attrs.options = attrs.key = attrs.oninit =
attrs.oncreate = attrs.onbeforeupdate = attrs.onupdate =
attrs.onbeforeremove = attrs.onremove = null
// Do this now so we can get the most current `href` and `disabled`.
// Those attributes may also be specified in the selector, and we
// should honor that.
var child = m(vnode.attrs.component || "a", attrs, vnode.children)
var child = m(vnode.attrs.selector || "a", attrs, vnode.children)
// Let's provide a *right* way to disable a route link, rather than
// letting people screw up accessibility on accident.

View file

@ -615,7 +615,7 @@ o.spec("route", function() {
route.prefix = prefix
root = $window.document.body
render(root, m(route.Link, {component: "button", href: "/test", foo: "bar"}, "text"))
render(root, m(route.Link, {selector: "button", href: "/test", foo: "bar"}, "text"))
o(root.childNodes.length).equals(1)
o(root.firstChild.nodeName).equals("BUTTON")
@ -635,7 +635,7 @@ o.spec("route", function() {
route.prefix = prefix
root = $window.document.body
render(root, m(route.Link, {component: "button[href=/test]", foo: "bar"}, "text"))
render(root, m(route.Link, {selector: "button[href=/test]", foo: "bar"}, "text"))
o(root.childNodes.length).equals(1)
o(root.firstChild.nodeName).equals("BUTTON")