react-typewriter icon indicating copy to clipboard operation
react-typewriter copied to clipboard

Change container element to a div instead of span since span can not have all elements as children according to W3C

Open yn5 opened this issue 8 years ago • 5 comments

W3C threw me an error when having a <p> element inside react-typewriter so I'd like to propose to change the container to be a <div> since it may have any element as a child.

yn5 avatar May 26 '16 14:05 yn5

This of course creates the problem in the other direction: now the react-typewriter can't have any element as a parent. @frostney @ianbjorndilling Any suggestions on how to fix the problem both ways?

yn5 avatar May 27 '16 12:05 yn5

@yn5 What do you think about having the container element as a prop? I feel like it should be span by default. From the top of my head, I some projects I worked on where it would break the layout if the container suddenly changed from span to div.

frostney avatar May 30 '16 07:05 frostney

@frostney Sounds like a good solution to me! I've added another commit to implement it.

yn5 avatar May 30 '16 12:05 yn5

@frostney What do you think of the code?

yn5 avatar Jun 03 '16 14:06 yn5

@frostney I noticed the PR caused a warning, added another commit to fix that.

yn5 avatar Aug 03 '16 10:08 yn5