WSTagsField icon indicating copy to clipboard operation
WSTagsField copied to clipboard

Actionsheet overlay triggers WSTagsField animation and renders tags in gray

Open wousser opened this issue 7 years ago • 3 comments

Which version of the WSTagsField are you using?

4.0.0

On which platform does the issue happen?

iOS 12

Are you using Carthage?

Carthage, latest

Are you using Cocoapods?

No

Which version of Xcode are you using?

Xcode latest

What did you do?

See title

Add a short snippet of code to show the problem

  • Have a tag field with multiple tags
  • Trigger an action sheet overlay

What did you expect to happen?

Tags field should not do an animation and tags should not change color

What happened instead?

See title, and capture: oct-27-2018 18-47-53

wousser avatar Oct 27 '18 10:10 wousser

@wousser Thank you for opening an issue. Could you share an example project please?

ricardopereira avatar Nov 02 '18 16:11 ricardopereira

I tested this and I couldn't reproduce your issue.

dec-13-2018 11-19-57

The code that I used for testing:

     @IBAction func touchAddRandomTags(_ sender: UIButton) {
+        let alertController = UIAlertController(title: "Test", message: "Actionsheet overlay triggers animation and renders tags in gray", preferredStyle: .actionSheet)
+        alertController.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil))
+        present(alertController, animated: true, completion: nil)
+        return;

I'll close this. Feel free to reopen the issue but please send me a reproducible sample to debug. Thanks.

ricardopereira avatar Dec 13 '18 11:12 ricardopereira

It is reproducible in the example. In the extension of the "ViewController" you can add this

        tagsField.onValidateTag = { (_, tags) in
            if !tags.isEmpty {
                let alert = UIAlertController(title: "Test", message: "AlertController overlay renders tags in gray", preferredStyle: .alert)
                alert.addAction(UIAlertAction(title: "Ok", style: .default, handler: nil))
                self.present(alert, animated: true, completion: nil)
            }
            return true
        }

From the prints in the debug area you can see that the 'Unselect' is called on each WSTagView after the alert is dismissed.

Unselect <WSTagsField.WSTagView: 0x7ff005f06a80; frame = (0 0.25; 49 24.5); clipsToBounds = YES; tintColor = <UIDynamicSystemColor: 0x600001c768a0; name = systemBlueColor>; gestureRecognizers = <NSArray: 0x6000012e3510>; animations = { backgroundColor=<CABasicAnimation: 0x600001cd5020>; }; layer = <CALayer: 0x600001cc9e00>>
Unselect <WSTagsField.WSTagView: 0x7ff005f2b7a0; frame = (59 0.25; 51.5 24.5); clipsToBounds = YES; tintColor = <UIDynamicSystemColor: 0x600001c768a0; name = systemBlueColor>; gestureRecognizers = <NSArray: 0x6000012ce880>; animations = { backgroundColor=<CABasicAnimation: 0x600001cd53c0>; }; layer = <CALayer: 0x600001c3d5a0>>
Unselect <WSTagsField.WSTagView: 0x7ff005e383f0; frame = (120.5 0.25; 51.5 24.5); clipsToBounds = YES; tintColor = <UIDynamicSystemColor: 0x600001c768a0; name = systemBlueColor>; gestureRecognizers = <NSArray: 0x6000012e56b0>; animations = { backgroundColor=<CABasicAnimation: 0x600001cd2080>; }; layer = <CALayer: 0x600001c23bc0>>

ibeleliev avatar Jun 22 '20 08:06 ibeleliev