Giter VIP home page Giter VIP logo

react-bootstrap-editable's Introduction

Hi there ๐Ÿ‘‹

react-bootstrap-editable's People

Contributors

nicokant avatar yassienw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

react-bootstrap-editable's Issues

autoFocus causing popover style to scroll browser to top

It seems this commit introduced a bug related to the autoFocus attribute

When an Editable:

  • is a textField type, and
  • uses mode="popover",

the first time the editable link is clicked, the browser screen will scroll to top. Subsequent opens of the same Editable popover won't do this.

This doesn't happen in version 0.5.1.

When we remove autoFocus from the Input element, this behaviour stops. But generally autoFocus is desirable, so it would be better to understand and cure this behaviour if possible.

It is definitely the autoFocus attribute. Other field types (which don't have autoFocus) are not affected (and they become affected by introducing autoFocus).

Can't figure out the rest, which sucks for me.

prevent page reload when pressing "Enter"

Hi, thanks for this library!
I've found a little problem while using it, when I edit a text if I press Enter I would expect the form containing the text field to be submitted without reloading the page.
Is there some configuration that could prevent this?

You can replicate this by visiting the storybook and just pressing Enter inside the text field while in editable mode.

Warning: A future version of React will block javascript: URLs as a security precaution. Use event handlers instead if you can. If you need to generate unsafe HTML try using dangerouslySetInnerHTML instead. React was passed "javascript:".

React 16.9 throw warning about javascript URLs in a tags while using bootstrap editable. The support for the javascript URL will be removed in the next major version of react. The issue is in esitable.js file line 181. A quick fix will be much appreciated.

{a && <a ref={this.clickableLink} className="ml-1 mt-auto" href="javascript:"

Placeholder

Sir I am not able to add placeholder to editable field in my component

The ajax function passed to an Editable is called twice

Expected behaviour

The ajax function provided to the Editable component should be called once if the validation was successful.

Actual behaviour

The ajax function provided is called twice if the validation was successful.

Steps to reproduce the behaviour

I have setup a storybook based on a fork of V0.8.0 located here: https://github.com/epigenesys/react-bootstrap-editable/tree/storybook

The last story features an Editable component with an ajax function that logs to the console. The following steps detail how to replicate the issue using this code.

  1. Checkout the storybook located at https://github.com/epigenesys/react-bootstrap-editable/tree/storybook.
  2. Run yarn install.
  3. Run yarn run storybook.
  4. Navigate to the 'Ajax' story.
  5. Open the console in developer tools.
  6. Change the value of the Editable and submit.
  7. Observe that there are two console messages.

I have attempted to keep the code above as simple as possible to replicate the issue. Please let me know if you have any difficulty replicating the issue.

Current theory as to the nature of the problem

The following is discussing the Editable.js file located here: https://github.com/YassienW/react-bootstrap-editable/blob/01b3fd899829100190956e1358989c5585307688/src/Editable.js

Both lines 108 and 207 add forms with the onFormSubmit function as their onSubmit. Adding console log statements to both of these lines show that they are both being called, which is then calling the ajax function twice. It looks like only one of these forms should have the onSubmit handler set to onFormSubmit.

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.