-
Notifications
You must be signed in to change notification settings - Fork 541
feat(tagsInput): Add ng-disabled support #349
Conversation
how about this functionality. I need this and I think its a good functionality. |
Hey @cezarpretto, I am sure @mbenford is working hard to get all the issues fixed asap. In the meantime you could use my fork of the bower release repo. The following commit contains the latest changes https://github.com/oteichmann/ngTagsInput-bower.git#7eb07b5e12be542c1cb89ce7773fc260d80de1a9 |
Thanks @oteichmann, It will be very helpful. |
Maybe by default hide placeholder text when ng-disabled="true"? When visible but grayed out it only confuses user. Also I am able to focus input by clicking the input, after this blue borders appear, however I'm unsure if this is because our custom styles. |
Hi @jukkasi, thanks for your comment. In fact i first followed the approach you suggest. But then I recognized that other bootstrap fields also do not hide the placeholder. Additionally it caused some styling issues if there is no tag left. That's why I decided to keep it. Regarding the focus issue. Which browser did you test with? I am pretty sure this had already been fixed with my latest commit. Regards, |
@oteichmann Could you take a look at #295? That PR and this one seem to solve the same problem. |
Hi @mbenford, I did already. As stated in my first comment this pull is based on #295. But there had been some merge conflicts in the original one. And some functionalities like disabling the input did not work as expected. I hope this pull here can be merged without any problems. Regards, |
I skimmed over the comments and missed yours. My bad. :( I wonder if you could work with @dlukez and merge both PRs into one? |
Of course we could... But I don't know if it is worth the effort. I just compared the two branches. If you do yourself you will recognize that the one of @dlukes is far behind the current master version of your component. My branch already contains all of the approaches / concepts from @dlukes as well as some more improvements. |
I just don't want to take anyone for granted. @dlukez's PR is around for a while, and yours seems to contain more improvements. I'd be very happy if you guys could sort it out. :) |
@mbenford take this one! Mine is old :) |
For Internet Explorer (11) everything works like I think it should regarding the focus issue, clicking disabled ng-tags-input does nothing visually. In Firefox 32 clicking disabled ng-tags-input I get gray "dotted" borders around input. For Chrome behavior is same than in FF but I get blue borders (our custom style I guess) It is still possible that your default styles are OK and something is wrong with ours. Another problem is that in IE 11 disabled placeholder text is much more visible than in other browsers. |
@@ -67,6 +67,22 @@ tags-input { | |||
border-color: #843534; | |||
@include box-shadow(inset 0 1px 1px rgba(0, 0, 0, .075), 0 0 6px #ce8483) | |||
} | |||
.disabled { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to target the tag-input
element directly, like this:
tags-input[disabled] {
...
}
That way you wouldn't need to set any class to any element.
Hey @mbenford, everything done. Please review. |
Thanks! Now, I'm not sure what has happened, but your PR's history is messed up. There are commits from the master branch among your own commits. It seems that you have merged the master branch into your own, instead of rebasing it on top of master. |
Hmm than maybe I understood something wrong. I just followed your contribution guidelines and executed "git rebase master -i" after updating the master from upstream... Maybe the problem is the following!?
|
Rebasing commits that already have been pushed is only an issue if other people have based their work on those commits. That's not the case for most forks, so there's no harm. I see a merge commit in your PR's history, so a merge was effectively done. The "correct" history should contain only one commit containing your changes, like this one. I suggest that you extract your changes and apply them to a clean branch. |
Hi @mbenford, |
You still need to squash your commits into a single one, with the |
Add an option for the user to disable the tags input component. Set ng-disabled to true will prevent any changes to the tags defined within the model. The field can not be focused any more. Anchors to remove tags will be disabled as well as the "add new" placeholder input. Closes mbenford#102.
@mbenford Done, please review. |
Thanks for this feature @oteichmann and thanks for the directive @mbenford, this blows away the other solutions. Just a note: the API documentation at http://mbenford.github.io/ngTagsInput/documentation/api doesn't reflect this PR, you can only find it by searching the repo. |
Great feature, thanks! Still the case it's not in the API though. |
Add an option for the user to disable the tags input component. Set ng-disabled to true will prevent any changes to the tags defined within the model. The field can not be focused any more. Anchors to remove tags will be hidden as well as the "add new" placeholder.
This pull is based on the existing one #295 but without any conflicts.
Closes #102.