Giter Site home page Giter Site logo

Comments (6)

jodinathan avatar jodinathan commented on May 14, 2024 2

this works:

<AwesomeButtonProgress
      element={({children, style, className}) =>
          <button style={style} className={className}
              type={'submit'}>{children}</button>}>
hello
</AwesomeButtonProgress>

from react-awesome-button.

meliborn avatar meliborn commented on May 14, 2024 1

@jodinathan it breaks my hover and press events. I did it like this:

class MyAwesomeButton extends AwesomeButton {
	constructor(props) {
		super(props);
		this.extraProps = {
			type: props.buttonType,
		};
	}
}

<MyAwesomeButton buttonType="submit|button" />

from react-awesome-button.

ugumba avatar ugumba commented on May 14, 2024

A related note: I'd like to use an AwesomeButton not as submit, but can't since there's no way to override the default <button> type.
In other words, if an AwesomeButton appears on a page with a <form>, the button will always submit the form.

from react-awesome-button.

Princejain21 avatar Princejain21 commented on May 14, 2024

Awesomebuttonprogress , Is it html tag or an imported component?

from react-awesome-button.

Neuroforge avatar Neuroforge commented on May 14, 2024

This is an absolute killer of an issue. I really want to use this library, but i am not maintaining button hacks site wide. This should be addressed as this library is awesome, but this problem is a deal breaker. :(

The typescript version is even worse! And it loses the animation effect. :(

    <AwesomeButton
      type={type}
      size="large"
      before={props.startIcon}
      disabled={props.disabled}
      element={
        childElement as React.ForwardRefExoticComponent<
          React.RefAttributes<
            HTMLAnchorElement | HTMLDivElement | HTMLButtonElement
          >
        >
      }
    >
      {props.children}
    </AwesomeButton>

This does indeed work, but i lose the animated button wobble. Everything else looks good, i think.

from react-awesome-button.

Neuroforge avatar Neuroforge commented on May 14, 2024

Ok.

This works as the element and maintains the animation.,

const NestedButton = forwardRef<HTMLButtonElement>((props, ref) => (
  <button ref={ref} {...props} />
));

from react-awesome-button.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.