I am trying to clear field NSSearchField
by clicking on the clear button on the right side. I am not able to click on it.
Here is a screen recording of what's happening at my end:
I used the following code found by RND:
[[[self.SrcFiled cell] cancelButtonCell] setAction:@selector(clearSearchField:)];
[[[self.SrcFiled cell] cancelButtonCell] setTarget:self];
But it is not working; I have no idea how to fix this issue. Please suggest how to fix this.
It's very strange. I got solution by just change TextBorderType
rectangle to rounded and this error got fix now i can able to click on clear button of NSSearchFiled
. and that working smooth as expected.
Old one in this clear button not responding:
Now with change clear button responding:
I had exactly the same issue, but my border was already set as shown in the accepted answer.
I found that my override of the mouseDown event, was blocking this behaviour.
- (void)mouseDown:(NSEvent *)theEvent
{
NSLog(@"SearchField.h mouseDown");
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With