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

Default Button Label appears in child classes of Button #1971

Open
tejaede opened this issue Apr 19, 2018 · 1 comment
Open

Default Button Label appears in child classes of Button #1971

tejaede opened this issue Apr 19, 2018 · 1 comment

Comments

@tejaede
Copy link
Collaborator

tejaede commented Apr 19, 2018

The default label in Button breaks backwards compatibility in classes that specialize Button. For example, take the following:

var Button = require("montage/ui/button.reel").Button;

exports.ActionButton = Button.specialize(/** @lends ActionButton.prototype */ {

With this commit "Button" is shoehorned into the element as seen below.

screen shot 2018-04-19 at 1 42 41 pm
screen shot 2018-04-19 at 1 43 27 pm

A quick fix on our end is to define empty label and defaultLabel properties in the Child class

var Button = require("montage/ui/button.reel").Button;

exports.ActionButton = Button.specialize(/** @lends ActionButton.prototype */ {

    defaultLabel: {
        value: ""
    },

    label: {
        value: ""
    },

However, the label is a breaking change if it is released and changes are not made in the implementing application.

For context, the use case for specializing button is two-fold:

  1. Custom Styling
  2. Act as link if a url is provided
@thibaultzanini
Copy link
Contributor

@marchant FYI

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

No branches or pull requests

2 participants